@media (min-width: 1250px) {
  html:has(body > .community-layout) { scrollbar-gutter: auto !important; }

  body {
    --feed-left-width: 270px;
    --feed-right-width: 380px;
    --feed-column-gap: 28px;
    --feed-edge: 24px;
    --feed-tablet-max-width: clamp(614px, calc(15.625vw + 364px), 664px);
    --feed-header-bottom: 88px;
  }

  html body > .community-layout {
    height: calc(100dvh - var(--feed-header-bottom));
    grid-template-columns: var(--feed-left-width) minmax(0, 1fr) var(--feed-right-width);
    grid-template-rows: minmax(0, 1fr);
    column-gap: var(--feed-column-gap);
    padding-inline: var(--feed-edge) !important;
  }

  html body > .community-layout > .community-rail,
  html body > .community-layout > .community-side {
    width: 100%;
    min-width: 0;
    margin-inline: 0;
    padding-inline: 0;
    border-inline-end: 0;
  }

  html body > .community-layout > .community-stage {
    align-items: center;
    position: relative;
  }

  .community-layout > .community-stage::before,
  .community-layout > .community-stage::after {
    content: '';
    position: absolute;
    inset-block: 0;
    border-inline-start: 1px solid #d9d5cb;
    pointer-events: none;
  }

  .community-layout > .community-stage::before {
    inset-inline-start: calc(var(--feed-column-gap) / -2);
  }

  .community-layout > .community-stage::after {
    inset-inline-end: calc(var(--feed-column-gap) / -2);
  }

  html body > .community-layout > .community-stage > :is(.community-title-row, #community-tablet) {
    width: min(100%, var(--feed-tablet-max-width)) !important;
    margin-inline: auto !important;
  }

  html body > .community-layout > .community-side > * { max-width: 100%; }

  html body > .paired-room-rail {
    inset-inline-start: calc(max(0px, (100vw - 1800px) / 2) + var(--feed-edge));
    width: calc(var(--feed-left-width) + var(--feed-column-gap) / 2);
    box-sizing: border-box;
    top: calc(var(--feed-header-bottom) + 10px);
    min-height: calc(100dvh - var(--feed-header-bottom) - 10px);
    padding-inline: 0 calc(var(--feed-column-gap) / 2 - 1px);
    border-inline-end: 1px solid #d9d5cb;
  }
}

@layer compact-corrections {
  @media (min-width: 1250px) {
    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]) {
      grid-template-columns: var(--feed-left-width) minmax(0, 1fr) !important;
      column-gap: var(--feed-column-gap) !important;
    }

    html body .community-rail > .community-profile {
      width: 100% !important;
      max-width: none !important;
    }

    html body .community-rail .community-room-board nav > .feed-room-link {
      display: grid !important;
      grid-template-columns: 55px 138px !important;
      align-items: center !important;
      justify-content: center !important;
      width: 100% !important;
      height: auto !important;
      min-height: clamp(64px, 9dvh, 90px) !important;
      padding: 9px 10px !important;
      gap: 11px !important;
    }

    html body .community-rail .community-room-board nav > .feed-room-link .community-door-number {
      width: auto !important;
      display: inline-flex !important;
      align-items: baseline;
      justify-content: center !important;
      gap: 2px;
      font: 700 26px/1 Georgia, serif !important;
    }

    html body .community-rail .community-room-board nav > .feed-room-link .community-door-number::after {
      content: '호';
      font: 700 12px/1 system-ui, sans-serif;
    }

    html body .community-rail .community-room-board nav > .feed-room-link .community-door-copy {
      height: auto !important;
      min-height: 0;
      padding-inline-start: 11px;
      border-inline-start: 1px solid #6573603b;
    }

    html body .community-rail .community-room-board nav > .feed-room-link .community-door-copy strong {
      font: 700 16px/1.25 system-ui, sans-serif !important;
      white-space: nowrap;
    }

    html body .community-rail .community-room-board nav > .feed-room-link .community-door-copy > small {
      display: block !important;
      font: 400 12px/1.35 system-ui, sans-serif !important;
      white-space: nowrap;
    }

    html body .community-rail .community-room-board nav > .feed-room-link .community-door-arrow {
      display: none !important;
    }
  }
}

@media (min-width: 761px) and (max-width: 1279px) {
  body { --feed-header-bottom: 158px; }

  html body:has(> .service-brand-inline) > .site-brand-copy.shared-brand-row.service-brand-inline {
    justify-content: center;
    gap: 16px;
  }

  html body > .site-brand-copy.shared-brand-row.service-brand-inline > .shared-feed-link {
    width: auto;
    gap: 8px;
  }

  html body > .site-brand-copy.shared-brand-row.service-brand-inline > .shared-feed-link::after {
    content: attr(aria-label);
    display: grid;
    place-items: center;
    box-sizing: border-box;
    width: 102px;
    height: 24px;
    padding-inline: 9px 4px;
    border: 0;
    background: url('/main-site/assets/service-mode-bubble.svg') center / 100% 100% no-repeat;
    color: #574a36;
    font: 600 11px/1.35 system-ui, sans-serif;
    white-space: nowrap;
  }
}

@media (min-width: 1250px) and (max-width: 1279px) {
  html:root body:has(> .site-brand-copy.shared-brand-row.service-brand-inline) {
    --feed-header-bottom: 88px;
    --service-inline-end: calc(3vw + 530px);
    padding-top: 88px !important;
  }

  html:root body[data-room-view]:has(> .service-brand-inline) {
    --service-inline-end: calc(3vw + 545px);
  }

  html:root body:has(> .site-brand-copy.shared-brand-row.service-brand-inline) > .site-brand-copy.shared-brand-row.service-brand-inline {
    inset: 0 var(--service-inline-end) auto calc(3vw + 320px) !important;
    z-index: 123;
    height: 88px;
    justify-content: center;
    gap: 6px;
    padding: 0;
    background: transparent !important;
    pointer-events: none;
  }

  html:root body > .site-brand-copy.shared-brand-row.service-brand-inline > .shared-feed-link {
    position: relative;
    width: 44px;
    height: 44px;
    pointer-events: auto;
  }

  html:root body > .site-brand-copy.shared-brand-row.service-brand-inline > .shared-feed-link::after {
    position: absolute;
    inset-inline-start: calc(100% + 4px);
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    animation: service-mode-hint 2.4s both;
  }

  html:root body:has(> .service-brand-inline) > .site-header.unified-shell > .shell-nav {
    width: 478px !important;
    flex: 0 0 478px !important;
    margin-inline-start: auto !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    column-gap: 10px !important;
  }

  html:root body:has(> .service-brand-inline) > .site-brand-copy.shared-brand-row.service-brand-inline > span {
    font-size: 17.5px !important;
  }
}


@keyframes service-mode-hint {
  0%, 100% { opacity: 0; }
  10%, 72% { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .service-brand-inline > .shared-feed-link::after {
    animation-timing-function: steps(1);
  }
}

@media (max-width: 760px) {
  html body > .community-layout .community-mobile-benefit-links { display: none; }
}
