/* Task 39: the desk switcher beside the brand, the read-only notice, and the read-only page variants.
   Tokens only (desk-base.css); the icons are bound in desk-icons.css like every other glyph. */

/* -- the switcher ------------------------------------------------------------------------------------------- */
.nav-wrap:has(.desk-switcher) {
  position: relative;
  grid-template-columns: auto auto minmax(0, 1fr);
}
.nav-wrap:has(.desk-switcher) > .who,
.nav-wrap:has(.desk-switcher) > .nav-link {
  grid-column: 3;
  justify-self: end;
}
.desk-switcher {
  grid-row: 1;
  grid-column: 2;
  justify-self: start;
  margin-left: calc(-1 * var(--space-2));
  flex: none;
}
.desk-switcher-summary {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  min-width: var(--hit);
  min-height: var(--hit);
  padding: 0 var(--space-3);
  border-radius: var(--radius-full);
  background: var(--fill-2);
  color: var(--ink);
  font: var(--type-subheadline);
  font-weight: 600;
  list-style: none;
  cursor: pointer;
}
.desk-switcher-summary::-webkit-details-marker {
  display: none;
}
.desk-switcher[open] > .desk-switcher-summary {
  background: var(--surface);
  box-shadow: var(--shadow-card);
}
.desk-switcher-caret {
  width: 1rem;
  height: 1rem;
}
.desk-switcher[open] .desk-switcher-caret {
  transform: rotate(180deg);
}
.desk-switcher-menu {
  position: absolute;
  top: var(--header-row-1);
  left: 0;
  z-index: 30;
  width: min(16rem, 100%);
  margin: 0;
  padding: var(--space-1);
  list-style: none;
  border: 1px solid var(--separator);
  border-radius: var(--radius-m);
  background: var(--surface);
  box-shadow: var(--shadow-popover);
}
.desk-switcher-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  min-height: var(--hit);
  padding: 0 var(--space-3);
  border-radius: var(--radius-s);
  color: var(--ink);
  font: var(--type-subheadline);
  text-decoration: none;
}
.desk-switcher-link:focus-visible {
  outline-offset: -3px;
}
.desk-switcher-link:active {
  background: var(--fill);
}
.desk-switcher-link[aria-current="page"] {
  color: var(--accent);
  font-weight: 700;
}
.desk-switcher-check {
  width: 1rem;
  height: 1rem;
  overflow: hidden;
  white-space: nowrap;
  text-indent: 100%; /* the ✓ text is only the no-CSS fallback; the mask in desk-icons.css draws the glyph */
}
@media (hover: hover) {
  .desk-switcher-summary:hover {
    background: var(--fill);
  }
  .desk-switcher-link:hover {
    background: var(--fill-2);
  }
}
@media (min-width: 640px) {
  .desk-switcher {
    position: relative;
  }
  .desk-switcher-menu {
    top: calc(100% + var(--space-1));
    width: auto;
    min-width: 12rem;
    max-width: calc(100vw - 2 * var(--gutter));
  }
}
@media (max-width: 639px) {
  .nav-wrap:has(.desk-switcher) > .who {
    grid-column: 1 / -1;
    justify-self: stretch;
  }
}
@media (prefers-reduced-motion: no-preference) {
  .desk-switcher[open] .desk-switcher-menu {
    animation: desk-switcher-in var(--duration-fast) var(--ease-out);
  }
  .desk-switcher-caret {
    transition: transform var(--duration-fast) var(--ease-out);
  }
}
@keyframes desk-switcher-in {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@media (forced-colors: active) {
  .desk-switcher-summary {
    border: 1px solid ButtonText;
  }
  .desk-switcher-link[aria-current="page"] {
    forced-color-adjust: none;
    background: Highlight;
    color: HighlightText;
  }
}

/* -- the read-only notice and the read-only page variants ---------------------------------------------------- */
.readonly-notice {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin: 0 0 var(--space-4);
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--separator);
  border-radius: var(--radius-m);
  background: var(--info-bg);
  color: var(--ink-2);
  font: var(--type-subheadline);
  font-weight: 600;
}
.readonly-notice-icon {
  width: 1.25rem;
  height: 1.25rem;
  --icon-color: var(--ink-3);
}
.lanes-note {
  margin: 0;
  color: var(--ink-3);
  font: var(--type-footnote);
}
.slot-text {
  padding: 0 var(--space-1);
  border-bottom: 1px solid var(--separator);
  font-weight: 600;
}
