.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 200;
  background: var(--surface);
  color: var(--ink);
  border: 2px solid var(--accent);
  border-radius: 10px;
  padding: 10px 14px;
  font-weight: 800;
}

.skip:focus {
  left: 8px;
  top: 8px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

:root {
  /* The rendered topbar height; the rail and aside stick exactly below it so they never tuck under. */
  --topbar-h: 76px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--surface);
  border-bottom: 2px solid var(--border);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 11px 18px;
  min-height: var(--topbar-h);
}

.brand {
  font-size: 20px;
  white-space: nowrap;
  color: var(--ink);
}

.brand-tagline {
  display: block;
  font-family: var(--sans);
  font-weight: 700;
  color: var(--link);
  font-size: 10.5px;
  letter-spacing: 0.6px;
}

.brand-wrap {
  position: relative;
  display: inline-flex;
  flex: none;
  flex-direction: column;
  align-items: flex-start;
}

/* The wordmark link stretches over the whole brand block, so the tagline under it still leads
   home while the alpha mark stays its own link on top. */
.brand::after {
  content: "";
  position: absolute;
  inset: 0;
}

.brand-title {
  display: inline-flex;
  align-items: flex-start;
}

/* A plain accent-coloured mark set like a superscript on the title, not a fourth shell button.
   It is still a real link so the alpha note is reachable without JavaScript. The negative top
   margin lifts its 24 px hit area above the title line, so it never makes the topbar taller. */
.alpha-badge {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  min-height: 24px;
  margin: -9px 0 0 1px;
  padding: 0 2px;
  border: 0;
  background: none;
  color: var(--link);
  font-family: var(--sans);
  font-size: 11.5px;
  font-weight: 900;
  letter-spacing: 0.02em;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}

.alpha-badge:hover {
  text-decoration: underline;
}

button.alpha-badge {
  appearance: none;
  margin: 0;
}

.searchwrap {
  flex: 1;
  max-width: 940px;
  position: relative;
  margin: 0;
}

.searchwrap input {
  width: 100%;
  padding: 12px 15px;
  border: 2px solid var(--border);
  border-radius: 13px;
  background: var(--field);
  color: var(--ink);
  font-size: 15px;
  font-weight: 600;
}

.searchwrap input::placeholder {
  color: var(--ink-3);
  font-weight: 500;
}

.searchwrap input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.kbd {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font: 11px var(--mono);
  color: var(--ink-3);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 2px 6px;
  background: var(--sunken);
}

.searchwrap.dirty input {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.searchwrap .applyhint {
  display: none;
  position: absolute;
  right: 11px;
  top: 50%;
  transform: translateY(-50%);
  align-items: center;
  font-size: 11.5px;
  font-weight: 800;
  color: var(--chip-text);
  background: var(--chip-bg);
  border: 1.5px solid var(--accent);
  border-radius: 999px;
  padding: 4px 10px;
  white-space: nowrap;
  pointer-events: none;
}

.searchwrap.dirty .applyhint {
  display: inline-flex;
}

.searchwrap.dirty .kbd {
  display: none;
}

.searchwrap .typeahead-mount {
  position: absolute;
  z-index: 50;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
  overflow: hidden;
  text-align: left;
}

.searchwrap .typeahead-mount[hidden] {
  display: none;
}

.searchwrap .typeahead-mount .grp {
  padding: 8px 13px 2px;
  font-family: var(--display);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--ink-3);
}

.searchwrap .typeahead-mount a.trow {
  display: flex;
  gap: 9px;
  align-items: center;
  padding: 7px 13px;
  color: var(--ink);
}

.searchwrap .typeahead-mount a.trow:hover,
.searchwrap .typeahead-mount a.trow.hi {
  background: var(--hover);
  text-decoration: none;
}

.searchwrap .typeahead-mount .tthumb {
  display: grid;
  place-items: center;
  width: 34px;
  height: 20px;
  flex: none;
  overflow: hidden;
  border: 1px solid var(--line-2);
  border-radius: 4px;
  background: var(--sunken);
}

.searchwrap .typeahead-mount .tthumb.avatar,
.searchwrap .typeahead-mount .tthumb.cover {
  width: 22px;
  height: 22px;
  border-radius: 999px;
}

.searchwrap .typeahead-mount .tthumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.searchwrap .typeahead-mount .tn {
  font-weight: 700;
}

.searchwrap .typeahead-mount .tnat {
  color: var(--ink-3);
  font-size: 12px;
  font-weight: 500;
}

.searchwrap .typeahead-mount .tk {
  margin-left: auto;
  font-size: 11px;
  color: var(--ink-3);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 1px 8px;
  white-space: nowrap;
}

.searchwrap .typeahead-mount .see {
  display: block;
  padding: 10px 13px;
  border-top: 1px solid var(--border);
  font-weight: 800;
  color: var(--accent);
  background: var(--sunken);
}

.searchwrap .typeahead-mount .see:hover {
  text-decoration: none;
}

.searchwrap .typeahead-mount .none {
  padding: 11px 13px;
  color: var(--ink-3);
  font-size: 13px;
}

.searchwrap .typeahead-mount .t-verified {
  background: var(--tier-verified-solid);
  color: var(--tier-verified);
  border-color: color-mix(in srgb, var(--tier-verified) 45%, transparent);
}

.searchwrap .typeahead-mount .t-curated {
  background: var(--tier-curated-solid);
  color: var(--tier-curated);
  border-color: color-mix(in srgb, var(--tier-curated) 45%, transparent);
}

.searchwrap .typeahead-mount .t-review {
  background: var(--tier-review-solid);
  color: var(--tier-review);
  border-color: color-mix(in srgb, var(--tier-review) 45%, transparent);
}

.searchwrap .typeahead-mount .t-auto {
  background: var(--tier-auto-solid);
  color: var(--tier-auto);
  border-color: color-mix(in srgb, var(--tier-auto) 45%, transparent);
}

.searchwrap .typeahead-mount .t-unverified {
  background: var(--tier-unverified-solid);
  color: var(--tier-unverified);
  border-color: color-mix(in srgb, var(--tier-unverified) 45%, transparent);
}

.searchwrap .typeahead-mount .t-untrusted {
  background: var(--tier-untrusted-solid);
  color: var(--tier-untrusted);
  border-color: color-mix(in srgb, var(--tier-untrusted) 45%, transparent);
}

/* 38 D38.4-D38.9: the top-search performance row (wide details link + media buttons beside) */
.searchwrap .typeahead-mount .trow {
  display: flex;
  gap: 9px;
  align-items: center;
  padding: 7px 13px;
  border-left: 4px solid var(--border);
  color: var(--ink);
}

.searchwrap .typeahead-mount .trow:hover {
  background: var(--hover);
}

.searchwrap .typeahead-mount .trow .tmain {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
  color: var(--ink);
}

.searchwrap .typeahead-mount .trow:hover .tmain {
  text-decoration: none;
}

.searchwrap .typeahead-mount .tline {
  display: flex;
  align-items: baseline;
  gap: 6px;
  min-width: 0;
}

.searchwrap .typeahead-mount .tline .tn {
  font-family: var(--display);
  font-weight: 800;
  font-size: 14px;
}

.searchwrap .typeahead-mount .tby {
  color: var(--ink-alt);
  font-weight: 600;
  font-size: 12.5px;
}

.searchwrap .typeahead-mount .tdur {
  flex: none;
  align-self: center;
  font-family: var(--display);
  font-weight: 800;
  font-size: 14px;
  color: var(--ink-3);
}

.searchwrap .typeahead-mount .tsub {
  color: var(--ink-3);
  font-size: 11.5px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.searchwrap .typeahead-mount .tsub-orig {
  color: var(--ink-alt);
}

.searchwrap .typeahead-mount .tmedia {
  display: flex;
  gap: 5px;
  flex: none;
}

.searchwrap .typeahead-mount .mediabtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--link);
}

.searchwrap .typeahead-mount .mediabtn .vi {
  width: 26px;
  height: 26px;
}

.searchwrap .typeahead-mount .mediabtn:hover {
  filter: brightness(1.12);
  text-decoration: none;
}

.searchwrap .typeahead-mount .trow .cls {
  font-size: 10px;
  font-weight: 900;
  border-radius: 999px;
  padding: 1px 7px;
  border: 1.5px solid transparent;
  white-space: nowrap;
}

.searchwrap .typeahead-mount .trow .cls-original {
  background: var(--tier-verified-solid);
  color: var(--tier-verified);
  border-color: color-mix(in srgb, var(--tier-verified) 45%, transparent);
}

.searchwrap .typeahead-mount .trow .cls-cover {
  background: var(--tier-curated-solid);
  color: var(--tier-curated);
  border-color: color-mix(in srgb, var(--tier-curated) 45%, transparent);
}

.searchwrap .typeahead-mount .trow .cls-parody,
.searchwrap .typeahead-mount .trow .cls-remix,
.searchwrap .typeahead-mount .trow .cls-sample,
.searchwrap .typeahead-mount .trow .cls-remaster,
.searchwrap .typeahead-mount .trow .cls-re-recording,
.searchwrap .typeahead-mount .trow .cls-instrumental,
.searchwrap .typeahead-mount .trow .cls-version {
  background: var(--tier-curated-solid);
  color: var(--tier-curated);
  border-color: color-mix(in srgb, var(--tier-curated) 45%, transparent);
}

.searchwrap .typeahead-mount .trow .cls-live,
.searchwrap .typeahead-mount .trow .cls-karaoke {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
}

.searchwrap .typeahead-mount .trow .tedit {
  margin-left: 4px;
  padding: 1px 7px;
  font-size: 10px;
  font-weight: 800;
  vertical-align: middle;
}

.top-right {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  white-space: nowrap;
}

/* The narrow top bar keeps the cluster in one Options panel (45 D45.5, FR-44). Wide: the panel is an inline flex
   group and the trigger is absent; at <=820 the panel becomes the dropdown and the trigger shows. */
.top-right .options-sel {
  display: none;
}

.options-panel {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pickers {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.icon,
.icon-btn,
.themebtn {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 2px solid var(--border);
  border-radius: 11px;
  background: var(--control);
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  color: var(--ink);
}

.icon:hover,
.icon-btn:hover,
.themebtn:hover {
  background: var(--hover);
  border-color: var(--accent);
  text-decoration: none;
}

.icon:focus-visible,
.icon-btn:focus-visible,
.themebtn:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.themesel {
  position: relative;
  display: inline-flex;
}

.picker-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 80;
  min-width: 220px;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 6px;
}

.picker-menu[hidden] {
  display: none;
}

.picker-menu ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.picker-menu .theme-opt,
.picker-menu .skin-opt {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  text-align: left;
  border: 1.5px solid var(--border);
  background: var(--control);
  color: var(--ink);
  padding: 8px 10px;
  border-radius: 9px;
  font-size: 13.5px;
  font-weight: 700;
  font-family: var(--sans);
  margin-bottom: 3px;
  text-decoration: none;
}

.picker-menu li:last-child .theme-opt,
.picker-menu li:last-child .skin-opt {
  margin-bottom: 0;
}

.picker-menu .theme-opt:hover,
.picker-menu .skin-opt:hover {
  background: var(--hover);
  text-decoration: none;
}

.picker-menu .theme-opt:focus-visible,
.picker-menu .skin-opt:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.picker-menu .theme-opt[aria-checked="true"],
.picker-menu .skin-opt[aria-checked="true"] {
  box-shadow: inset 0 0 0 2px var(--accent);
}

.picker-menu .em {
  font-size: 16px;
  line-height: 1;
}

.picker-menu .nm {
  flex: 1;
}

.picker-menu .sws {
  display: flex;
  gap: 3px;
  margin-left: auto;
}

.picker-menu .sw,
.themebtn .sw {
  border-radius: 999px;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.12);
}

.picker-menu .sw {
  width: 11px;
  height: 11px;
}

.themebtn .sw {
  width: 16px;
  height: 16px;
}

.picker-menu .tick {
  color: var(--accent);
  font-weight: 900;
  width: 12px;
  text-align: center;
}

.picker-menu .skin-opt .spv,
.seg .skin-opt .spv {
  flex: none;
  width: 42px;
  height: 25px;
  display: grid;
  place-items: center;
  border: 2px solid var(--border);
  background: var(--surface);
  border-radius: 7px;
  font-family: var(--sans);
  font-size: 13.5px;
  line-height: 1;
  color: var(--ink);
}

.picker-menu .skin-opt.skin-compact .nm,
.seg .skin-opt.skin-compact .nm {
  font-size: 12.5px;
  letter-spacing: -0.3px;
}

.picker-menu .skin-opt.skin-compact .spv,
.seg .skin-opt.skin-compact .spv {
  font-size: 10.5px;
  letter-spacing: -0.6px;
  width: 31px;
  height: 18px;
  border-radius: 4px;
}

.picker-menu .skin-opt.skin-arcade .nm,
.seg .skin-opt.skin-arcade .nm {
  font-family: var(--pixel);
  letter-spacing: 0.3px;
}

.picker-menu .skin-opt.skin-arcade .spv,
.seg .skin-opt.skin-arcade .spv {
  font-family: var(--pixel);
  font-weight: 700;
  border-radius: 0;
  box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.45);
  color: var(--link);
}

.drawer {
  display: none;
  position: relative;
}

.drawer-toggle {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 2px solid var(--border);
  border-radius: 11px;
  background: var(--control);
  color: var(--ink);
  padding: 8px 10px;
  font-weight: 800;
  font-size: 13px;
  min-height: 36px;
}

.drawer-toggle::-webkit-details-marker {
  display: none;
}

.drawer-toggle .ico {
  font-size: 16px;
  line-height: 1;
}

.drawer[open] .drawer-toggle {
  border-color: var(--accent);
  background: var(--hover);
}

.drawer-nav {
  display: none;
}

/*
 * The rail toggle sits on the rail's closing line, centred on it at the very top of the content area: the arrow points
 * at the direction the rail will move. The button is an enhancement (theme.js owns the click and the stored choice);
 * the icons stay real links in every state, so navigation works without JavaScript.
 */
.rail-toggle {
  position: absolute;
  top: 8px;
  left: var(--rail-w);
  transform: translateX(-50%);
  z-index: 6;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 2px solid var(--accent);
  border-radius: 999px;
  background: var(--surface);
  color: var(--accent);
  cursor: pointer;
  line-height: 1;
}

.rail-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--hover);
}

.rail-toggle:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.rail-toggle > span {
  display: grid;
  place-items: center;
  line-height: 0;
}

.rail-toggle .vi {
  width: 15px;
  height: 15px;
  vertical-align: 0;
  transform: rotate(180deg);
  transition: transform 0.15s ease;
}

html[data-rail="collapsed"] .rail-toggle {
  left: var(--rail-w-collapsed);
}

html[data-rail="collapsed"] .rail-toggle .vi {
  transform: rotate(0deg);
}

html[data-rail="collapsed"] .shell {
  grid-template-columns: var(--rail-w-collapsed) minmax(0, 1fr);
}

html[data-rail="collapsed"] #rail-nav {
  padding-left: 6px;
  padding-right: 6px;
}

/*
 * The section headings disappear in the icon-only rail, but their line box and margins stay so the group rhythm is
 * identical to the expanded rail. The label stays in the DOM (off-screen) for assistive technology.
 */
html[data-rail="collapsed"] #rail-nav h4 {
  text-indent: -9999px;
  margin-left: 0;
  margin-right: 0;
  white-space: nowrap;
  overflow: hidden;
}

html[data-rail="collapsed"] #rail-nav a {
  justify-content: center;
  gap: 0;
  padding-left: 0;
  padding-right: 0;
  line-height: 22px;
  font-size: 0;
}

html[data-rail="collapsed"] #rail-nav a .ico {
  font-size: 19px;
  width: auto;
}

.shell {
  --rail-w: 236px;
  --rail-w-collapsed: 58px;
  position: relative;
  display: grid;
  grid-template-columns: var(--rail-w) minmax(0, 1fr);
  min-height: calc(100vh - 104px);
}

.shell:not(:has(> .rail)) {
  grid-template-columns: minmax(0, 1fr);
}

.rail {
  border-right: 2px solid var(--border);
  background: var(--surface);
  padding: 14px 10px;
  position: sticky;
  top: var(--topbar-h);
  align-self: start;
  height: calc(100vh - var(--topbar-h));
  overflow: auto;
}

.rail h4,
.drawer-nav h4 {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.9px;
  color: var(--ink-3);
  margin: 16px 9px 6px;
}

.rail h4:first-child,
.drawer-nav h4:first-child {
  margin-top: 2px;
}

.rail a,
.drawer-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  border-radius: 10px;
  color: var(--ink-alt);
  font-size: 14px;
  font-weight: 600;
  min-height: 34px;
}

.rail a:hover,
.drawer-nav a:hover {
  background: var(--hover);
  text-decoration: none;
  color: var(--ink);
}

.rail a.active,
.drawer-nav a.active {
  background: var(--accent-soft);
  color: var(--ink);
  font-weight: 800;
}

.rail a.rail-discord,
.drawer-nav a.rail-discord,
.rail a.rail-discord:hover,
.drawer-nav a.rail-discord:hover {
  color: var(--link);
}

.rail .ico,
.drawer-nav .ico {
  display: grid;
  place-items: center;
  width: 18px;
  line-height: 0;
  opacity: 0.9;
}

.main {
  /* The entity aside column is pulled up by this value so its surface starts flush with the topbar. */
  --main-pad-top: 24px;
  --main-pad-bottom: 72px;
  padding: var(--main-pad-top) 32px var(--main-pad-bottom);
  min-width: 0;
}

.verify-banner,
.nudge,
.blocked-strip {
  border-radius: 12px;
  padding: 12px 14px;
  margin: 0 0 16px;
  font-size: 13.5px;
}

.verify-banner {
  border: 2px solid var(--accent);
  background: var(--accent-soft);
  color: var(--ink);
}

.nudge {
  border: 2px solid var(--border);
  background: var(--surface);
  color: var(--ink);
}

.blocked-strip {
  border: 2px dashed var(--border);
  background: var(--sunken);
  color: var(--ink-alt);
}

.verify-banner p,
.nudge p {
  margin: 0;
}

.nudge-title {
  margin: 0 0 4px;
  font-size: 15px;
}

.banner-actions,
.nudge-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
}

.banner-actions form,
.nudge-actions form {
  margin: 0;
}

.aside {
  border-left: 2px solid var(--border);
  background: var(--surface);
  /* Matches the rail's compact first-heading offset instead of the main's larger top padding. */
  padding: 16px 18px 18px;
  position: sticky;
  top: var(--topbar-h);
  align-self: start;
  max-height: calc(100vh - var(--topbar-h));
  overflow: auto;
}

.aside h4 {
  margin: 0 0 8px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: var(--link);
}

.aside > h4 {
  margin-top: 22px;
}

.aside > h4:first-child {
  margin-top: 0;
}

.entity-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  /* The lead row is sized by the header alone. The aside spans both rows, so without this it can
     distribute its own height across the auto rows and push the first section far below the
     header; the sections row takes the remaining space instead. */
  grid-template-rows: auto 1fr;
  column-gap: 32px;
  align-items: stretch;
  margin-right: -32px;
}

.entity-layout:not(:has(> .entity-aside-col)) {
  grid-template-columns: minmax(0, 1fr);
  margin-right: 0;
}

.entity-lead {
  grid-column: 1;
  grid-row: 1;
  min-width: 0;
}

.entity-aside-col {
  grid-column: 2;
  grid-row: 1 / span 2;
  min-width: 0;
  margin-top: calc(-1 * var(--main-pad-top, 0px));
}

.entity-sections {
  grid-column: 1;
  grid-row: 2;
  min-width: 0;
  padding-top: 4px;
}

/* The first section belongs to the header: it opens just below it rather than carrying the same
   inter-section spacing a later section needs. */
.entity-sections > .sec-block:first-child > details.entity-sec > summary.sec-summary {
  margin-top: 12px;
}

.mobile-nav {
  display: none;
}

/*
 * An entity page's side panels run to the footer: the main's bottom padding moves into the section
 * stack so the aside column can stretch to the shell bottom instead of ending under its content.
 */
.shell.with-aside .main {
  padding-bottom: 0;
}

.shell.with-aside .entity-sections {
  padding-bottom: var(--main-pad-bottom, 72px);
}

.shell:has(> .rail) ~ .sitefoot {
  margin-top: 0;
}

/*
 * The aside surface belongs to the column on desktop, so it reaches the footer even when the panel
 * content is shorter than the page. The sticky panel scrolls within the tall column.
 */
@media (min-width: 1081px) {
  .entity-aside-col {
    background: var(--surface);
    border-left: 2px solid var(--border);
  }

  .entity-aside-col > .aside {
    background: transparent;
    border-left: 0;
  }
}

@media (max-width: 1080px) {
  .aside {
    display: none;
  }

  .entity-layout {
    grid-template-columns: minmax(0, 1fr);
    margin-right: 0;
  }

  .entity-lead,
  .entity-aside-col,
  .entity-sections {
    grid-column: 1;
    grid-row: auto;
  }

  .entity-aside-col {
    display: none;
  }
}

@media (max-width: 820px) {
  .shell,
  html[data-rail="collapsed"] .shell {
    grid-template-columns: minmax(0, 1fr);
  }

  .rail {
    display: none;
  }

  .rail-toggle {
    display: none;
  }

  .drawer {
    display: block;
  }

  .drawer .drawer-nav {
    display: block;
    position: absolute;
    left: 0;
    top: calc(100% + 8px);
    z-index: 70;
    width: min(300px, 86vw);
    max-height: 70vh;
    overflow: auto;
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: 13px;
    box-shadow: var(--shadow);
    padding: 10px;
  }

  .entity-aside-col {
    display: block;
    margin-top: 0;
  }

  .aside {
    display: block;
    position: static;
    height: auto;
    border-left: 0;
    border-top: 2px solid var(--border);
  }

  .entity-aside-col .aside {
    padding-top: 18px;
  }

  .topbar {
    padding: 9px 12px;
    gap: 10px;
  }

  .topbar .brand-tagline {
    display: none;
  }

  .top-right .who {
    display: none;
  }

  .top-right .options-sel {
    display: grid;
  }

  .options-panel {
    display: none;
    position: absolute;
    right: 12px;
    top: calc(100% - 2px);
    z-index: 80;
    width: min(92vw, 430px);
    padding: 10px;
    flex-wrap: wrap;
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: 12px;
    box-shadow: var(--shadow);
  }

  .options-panel[data-open="true"] {
    display: flex;
  }

  .options-panel .picker-menu {
    right: auto;
    left: 0;
  }

  .searchwrap {
    min-width: 0;
  }

  .main {
    --main-pad-top: 18px;
    --main-pad-bottom: 88px;
    padding: var(--main-pad-top) 16px var(--main-pad-bottom);
    padding-block-end: 88px;
  }

  .mobile-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--surface);
    border-top: 2px solid var(--border);
    z-index: 60;
  }

  .mobile-nav a {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    text-align: center;
    padding: 9px 2px;
    min-height: 48px;
    font-size: 10.5px;
    font-weight: 700;
    color: var(--ink-3);
    position: relative;
  }

  .mobile-nav a .ico {
    display: block;
    font-size: 18px;
    font-weight: 400;
    line-height: 1;
  }

  .mobile-nav a.active {
    color: var(--link);
  }

  .mobile-nav .soon {
    position: absolute;
    top: 2px;
    right: 3px;
    margin: 0;
    font-size: 8px;
    line-height: 1;
  }
}

@media (max-width: 520px) {
  .searchwrap .kbd {
    display: none;
  }

  /* F-M2: the dropdown is only as wide as the top-bar search input, collapsing the D38.9 performance row's .tmain
     to width 0. Anchor its right edge to the input and let it extend left so the row keeps a usable width; the width
     subtracts the Options trigger and the bar padding (60 px) so it stays on-screen on both edges and stays a little
     wider than the input on the portal. */
  .searchwrap .typeahead-mount {
    left: auto;
    right: 0;
    width: min(calc(100vw - 60px), 400px);
    max-height: calc(100vh - 110px);
    overflow-y: auto;
  }

  .searchwrap .applyhint {
    padding: 3px 8px;
    font-size: 10.5px;
  }

  .top-right .hide-sm {
    display: none;
  }
}

.soon {
  display: inline;
  margin-inline-start: 4px;
  font-size: 10px;
  line-height: 1;
  color: var(--link);
  white-space: nowrap;
  vertical-align: baseline;
}

a.is-disabled,
span.provider.is-disabled,
.btn.is-disabled,
.auth-tabs span.is-disabled {
  color: var(--ink-3);
  cursor: default;
  text-decoration: none;
}

span.provider.is-disabled,
span.provider.is-disabled:hover,
.btn.is-disabled,
.btn.is-disabled:hover {
  border-color: var(--border);
  background: var(--control);
  color: var(--ink-3);
}

.auth-tabs span.is-disabled {
  display: inline-block;
  padding: 8px 14px;
}

.soon.dev {
  animation: none;
  color: var(--ink-3);
  border: 1px dashed var(--ink-3);
  border-radius: 4px;
  padding: 1px 3px;
}

a.icon.is-disabled,
a.icon.is-disabled:hover {
  color: var(--ink-3);
  opacity: 0.55;
  cursor: default;
}

a.is-disabled .ico,
a.is-disabled .vi,
a.is-disabled svg {
  opacity: 0.55;
}

.rail a.is-disabled,
.drawer-nav a.is-disabled,
.mobile-nav a.is-disabled,
.nmenu a.is-disabled,
.nmenu .nh a.is-disabled,
.nmenu .ni.is-disabled {
  color: var(--ink-3);
  cursor: default;
}

.rail a.is-disabled:hover,
.drawer-nav a.is-disabled:hover,
.mobile-nav a.is-disabled:hover,
.nmenu a.is-disabled:hover,
.nmenu .nh a.is-disabled:hover,
.nmenu .ni.is-disabled:hover {
  background: transparent;
  color: var(--ink-3);
  text-decoration: none;
}

.rail a.is-disabled .ico,
.drawer-nav a.is-disabled .ico,
.mobile-nav a.is-disabled .ico {
  opacity: 0.55;
}

html[data-rail="collapsed"] #rail-nav .soon {
  display: none;
}

@keyframes soon-glow {
  0%,
  100% {
    text-shadow: 0 0 0 transparent;
  }

  50% {
    text-shadow: 0 0 6px color-mix(in srgb, var(--link) 65%, transparent);
  }
}

@media (prefers-reduced-motion: no-preference) {
  .soon {
    animation: soon-glow 3.5s ease-in-out infinite;
  }

  .soon.dev {
    animation: none;
  }
}

/* 69 D69.21: the compact door row - thumbnail plus at most two ellipsised text lines, no chips */
.searchwrap .typeahead-mount .trow-compact .tlines {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.searchwrap .typeahead-mount .trow-compact .tl1,
.searchwrap .typeahead-mount .trow-compact .tl2 {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
