:is(.community-mode-slot, .playground-mode-slot) .space-switch-hint {
  display: none;
}

@media (min-width: 1051px) {
  :is(.community-mode-slot, .playground-mode-slot) .space-switch-hint {
    display: inline-block;
  }
}

@media (min-width: 1250px) {
  body {
    --paired-frame: min(100vw, 1800px);
    --paired-inner: calc(var(--paired-frame) - 48px);
    --paired-rail: calc(var(--paired-inner) * .2);
    --paired-gap: 36px;
    --paired-start: calc(var(--paired-rail) + var(--paired-gap));
    --paired-icon-end: calc(var(--paired-inner) * .45 + min(var(--paired-inner) * .25, (100dvh - 130px) * .41));
  }

  body .community-layout .community-stage {
    align-items: flex-start;
  }

  body .community-stage :is(.community-title-row, #community-tablet) {
    width: calc(var(--paired-icon-end) - var(--paired-start)) !important;
    margin-left: var(--paired-gap) !important;
  }

  html body:is([data-room-view="stories"], [data-room-view="relay"], [data-room-view="poetry"], [data-room-view="room-104"]) > .playground-mode-row {
    width: min(100%, 1800px);
    height: 64px;
    margin: 10px auto 0;
    padding: 0 24px 14px;
    display: grid;
    grid-template-columns: calc((100% - 48px) * .2 + 36px) minmax(0, 1fr);
    box-sizing: border-box;
    position: relative;
  }

  body:is([data-room-view="stories"], [data-room-view="relay"], [data-room-view="poetry"], [data-room-view="room-104"]) .playground-mode-row .site-brand-copy {
    grid-column: 2;
    margin: 0;
    line-height: 1.4;
    letter-spacing: -.035em;
  }

  body:is([data-room-view="stories"], [data-room-view="relay"], [data-room-view="poetry"], [data-room-view="room-104"]) .playground-mode-slot {
    position: absolute;
    top: 0;
    right: calc(24px + (100% - 48px) * .55 - min((100% - 48px) * .25, (100dvh - 130px) * .41));
  }

  .playground-mode-slot .space-switch-hint {
    background: #fffdf6;
  }

  @layer compact-corrections {
    html body:is([data-room-view="stories"], [data-room-view="relay"], [data-room-view="poetry"], [data-room-view="room-104"]) main > :is(#stories, #relay, #poetry).room-system:has(.paired-room-panels) {
      display: grid !important;
      grid-template-columns: 20% minmax(0, 1fr) !important;
      width: min(100%, 1800px) !important;
      max-width: 1800px !important;
      margin: 0 auto !important;
      padding: 0 24px 16px !important;
      gap: 36px !important;
      height: calc(100dvh - 162px) !important;
      overflow: visible !important;
      background: transparent !important;
    }

    :is(#stories, #relay, #poetry):has(.paired-room-panels) > .story-sidebar,
    :is(#stories, #relay, #poetry):has(.paired-room-panels) > .story-sidebar .approved-room-menu {
      display: none !important;
    }

    :is(#stories, #relay, #poetry).room-system > :is(.weekly-wall-area, .relay-manuscript, .poetry-content):has(.paired-room-panels) {
      grid-column: 2 !important;
      width: 100% !important;
      background: transparent !important;
      border: 0 !important;
      box-shadow: none !important;
    }

    :is(#stories, #relay, #poetry).room-system .paired-room-panels {
      display: grid;
      grid-template-columns: 220px minmax(0, 1fr);
      gap: 16px;
      margin-bottom: 14px;
      flex: none;
    }

    html body:is([data-room-view="stories"], [data-room-view="relay"], [data-room-view="poetry"], [data-room-view="room-104"]) main :is(#stories, #relay, #poetry).story-classroom.room-system .paired-room-panels :is(.room101-menu-heading, .room-heading) {
      width: 100% !important;
      height: auto !important;
      min-height: 0 !important;
      padding: 10px 16px !important;
      margin: 0 !important;
    }
  }

  body > .paired-room-rail {
    position: relative;
    top: -64px;
    border-right: 1px solid #d9d5cb;
    padding: 0 24px 0 0;
  }

  body > .paired-room-rail [aria-current="page"] {
    background: #dce5cd;
    border-color: #9cae88;
  }

  body > .paired-room-rail .community-profile {
    display: flex;
    align-items: center;
  }

  body > .paired-room-rail .community-profile-avatar {
    position: relative;
    overflow: hidden;
    flex: none;
    background: #eee9dc;
  }

  body > .paired-room-rail .feed-author-photo {
    position: relative;
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
}

@media (min-width: 1250px) {
  body:not(:is([data-room-view="stories"], [data-room-view="relay"], [data-room-view="poetry"], [data-room-view="room-104"])) > .paired-room-rail { display: none !important; }

  html:has(body > .playground-mode-row) {
    scrollbar-width: none;
  }

  body .community-stage .community-title-row {
    justify-content: space-between;
  }

  @layer compact-corrections {
    html body:is([data-room-view="stories"], [data-room-view="relay"], [data-room-view="poetry"], [data-room-view="room-104"]) main > :is(#stories, #relay, #poetry).room-system:has(.paired-room-panels) {
      position: relative !important;
      row-gap: 0 !important;
    }
    html body:is([data-room-view="stories"], [data-room-view="relay"], [data-room-view="poetry"], [data-room-view="room-104"]) :is(#stories, #relay, #poetry).room-system > :is(.weekly-wall-area, .relay-manuscript, .poetry-content):has(.paired-room-panels) {
      grid-row: 1 !important;
      padding: 0 !important;
      gap: 0 !important;
    }
    html body:is([data-room-view="stories"], [data-room-view="relay"], [data-room-view="poetry"], [data-room-view="room-104"]) main :is(#stories, #relay, #poetry).story-classroom.room-system .paired-room-panels :is(.room101-menu-heading, .room-heading) {
      height: auto !important;
      min-height: 0 !important;
      padding-block: 10px !important;
    }
  }

  body > .paired-room-rail {
    display: flex;
    flex-direction: column;
    position: fixed;
    z-index: 2;
    top: 98px;
    left: 3%;
    width: calc(var(--paired-rail) + var(--rail-start-adjustment));
    min-height: calc(100dvh - 98px);
    box-sizing: border-box;
  }

  body > .paired-room-rail .community-room-board nav {
    display: flex;
    flex-direction: column;
  }
}

@media (min-width: 1250px) {
  html body > .paired-room-rail .community-room-board .feed-room-link[aria-current="page"] {
    background: #dce5cd;
    border-color: #9cae88;
  }

  html body:is([data-room-view="stories"], [data-room-view="relay"], [data-room-view="poetry"], [data-room-view="room-104"]) main :is(#stories, #relay, #poetry).story-classroom.room-system .paired-room-panels {
    --room-heading-height: 144px;
  }

  html body:is([data-room-view="stories"], [data-room-view="relay"], [data-room-view="poetry"], [data-room-view="room-104"]) main :is(#stories, #relay, #poetry).story-classroom.room-system .paired-room-panels > .room101-menu-heading {
    padding-block: 10px !important;
    min-height: 0 !important;
    height: auto !important;
  }
}


@media (min-width: 1250px) {
  body {
    --rail-start-adjustment: calc(max(24px, (100vw - 1800px) / 2 + 24px) - 3vw);
  }

  /* The rail extends left to align with the header logo on wide screens. */
  body .community-layout {
    overflow: visible;
  }

  body .community-layout > .community-rail {
    margin-inline-start: calc(-1 * var(--rail-start-adjustment));
    overflow: visible;
  }
}

/* Keep the current room distinct in both versions of the room menu. */
html body[data-room-view] :is(.paired-room-rail .feed-room-link, .room-system .approved-room-link) {
  filter: saturate(.55);
}

html body[data-room-view] :is(.paired-room-rail .feed-room-link[aria-current="page"], .room-system .approved-room-link.is-active) {
  position: relative;
  z-index: 1;
  filter: none;
  border-color: #385543 !important;
  box-shadow: inset 0 0 0 1px #385543, 0 3px 0 #385543, 0 5px 7px #263e3429 !important;
}

/* 104 shares the same PC rail and mode row; only its right-hand content differs. */
.reserved-desktop-preview {display:none}
@media(min-width:1250px){
 @layer compact-corrections {
  html body[data-room-view="room-104"] main > #room-104.reserved-room:not([hidden]) {
   display:grid!important;grid-template-columns:20% minmax(0,1fr)!important;
   width:min(100%,1800px)!important;max-width:1800px!important;
   margin:0 auto!important;padding:0 24px 16px!important;gap:36px!important;
   height:calc(100dvh - 162px)!important;min-height:0!important;
   overflow:auto!important;background:transparent!important;
  }
  html body[data-room-view="room-104"] #room-104.reserved-room > :is(.story-sidebar,.reserved-room-status){display:none!important}
 }
 #room-104 .reserved-desktop-preview {
  grid-column:2;display:flex;flex-direction:column;min-width:0;min-height:420px;
  border:1px solid #ddd9cd;border-radius:12px;background:#fbfaf5;
  box-shadow:0 2px 0 #e4e0d4;padding:20px 28px;box-sizing:border-box;
 }
 .reserved-preview-label{font:600 13px/1.5 sans-serif;color:#76664f;padding-bottom:14px;border-bottom:1px solid #e9e4d8}
 .reserved-preview-body{flex:1;display:flex;flex-direction:column;justify-content:center;align-items:center;text-align:center;padding:16px}
 .reserved-preview-art{width:240px;max-height:180px;height:auto;flex-shrink:0}
 .reserved-preview-kicker{font:600 11px/1.5 sans-serif;letter-spacing:2px;color:#8d795b;margin:10px 0}
 #room-104 #reserved-preview-title{font:700 26px/1.5 'Apple SD Gothic Neo','Malgun Gothic',sans-serif;color:#294637;margin:0}
 .reserved-preview-copy{font:15px/1.8 'Apple SD Gothic Neo','Malgun Gothic',sans-serif;color:#77776a;margin:14px 0 18px}
 .reserved-preview-status{font:600 12px/1.5 sans-serif;color:#6a715c;background:#e9eddf;border-radius:4px;padding:6px 12px}
}

/* Desktop profile rail and content share the same ten-pixel header inset. */
@media (min-width: 1250px) {
  @layer compact-corrections {
    html body:is([data-room-view="stories"], [data-room-view="relay"], [data-room-view="poetry"], [data-room-view="room-104"]) main > :is(#stories, #relay, #poetry).room-system:has(.paired-room-panels),
    html body[data-room-view="room-104"] main > #room-104.reserved-room:not([hidden]) {
      padding-block-start: 10px !important;
    }
  }
  html body .community-stage > #community-tablet { margin-block-start: 0 !important; }
}
