/* Home-only responsive layout selected in the July design review.
   Mobile keeps NativeMobileHome; medium screens use the top utility row. */

.friend-tile .av,
.friend-tile .avbg {
  border-radius: 10px !important;
}

.frow.off {
  opacity: 1 !important;
}

@media (min-width: 761px) and (max-width: 1449px) {
  .app3--home {
    --home-gap: 10px;
    --home-structure-border: 3px solid rgba(255, 255, 255, 0.18);
    display: grid;
    grid-template-columns: 74px 284px minmax(0, 1fr);
    grid-template-rows: 64px minmax(0, 1fr);
    grid-template-areas:
      "rail utilities utilities"
      "rail lives stage";
    gap: var(--home-gap);
    box-sizing: border-box;
    height: 100%;
    min-width: 0;
    min-height: 0;
    padding: 10px;
    overflow: hidden;
  }

  .app3--home > .rail { grid-area: rail; }
  .app3--home > .lives { grid-area: lives; }
  .app3--home > .stage { grid-area: stage; }
  .app3--home > .home-utilities { grid-area: utilities; }

  .app3--home > .rail,
  .app3--home > .lives,
  .app3--home > .stage > .chat,
  .app3--home > .home-utilities > .mwidget--rail,
  .app3--home > .home-utilities > .mlist {
    border: var(--home-structure-border) !important;
    border-radius: 14px !important;
    box-sizing: border-box;
  }

  .app3--home > .rail {
    width: auto !important;
    height: auto !important;
    margin: 0 !important;
    padding: 10px 0 !important;
    overflow: hidden !important;
  }

  .app3--home > .lives {
    width: auto !important;
    min-width: 0 !important;
    min-height: 0 !important;
    max-height: none !important;
    margin: 0 !important;
    overflow: hidden !important;
  }

  .app3--home > .stage {
    min-width: 0;
    min-height: 0;
    margin: 0 !important;
    padding: 0 !important;
    gap: 0 !important;
    overflow: hidden;
  }

  .app3--home > .stage > .chat {
    width: 100%;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
  }

  .app3--home > .home-utilities {
    display: grid;
    grid-template-columns: clamp(300px, 34%, 360px) minmax(0, 1fr);
    align-items: stretch;
    gap: var(--home-gap);
    min-width: 0;
    min-height: 0;
    overflow: visible;
  }

  .app3--home > .home-utilities > .mwidget--rail {
    grid-column: 1;
    width: 100% !important;
    height: 64px !important;
    min-width: 0 !important;
    min-height: 64px !important;
    max-height: 64px !important;
    margin: 0 !important;
    padding: 7px 9px !important;
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 8px !important;
    overflow: hidden !important;
    background: rgba(9, 12, 14, 0.78) !important;
    -webkit-backdrop-filter: blur(18px) saturate(135%);
    backdrop-filter: blur(18px) saturate(135%);
    box-shadow: none !important;
  }

  .app3--home > .home-utilities > .mwidget--rail .mwidget__open {
    flex: 1 1 auto;
    width: auto;
    min-width: 0;
    min-height: 44px;
    grid-template-columns: 40px minmax(0, 1fr);
    gap: 9px;
    padding: 0;
  }

  .app3--home > .home-utilities > .mwidget--rail .mwidget__art {
    width: 40px;
    height: 40px;
    border-radius: 9px;
  }

  .app3--home > .home-utilities > .mwidget--rail .mwidget__ti {
    display: block;
    font-size: 12.5px;
  }

  .app3--home > .home-utilities > .mwidget--rail .mwidget__ar,
  .app3--home > .home-utilities > .mwidget--rail .mwidget__railscrub,
  .app3--home > .home-utilities > .mwidget--rail .mwidget__x {
    display: none !important;
  }

  .app3--home > .home-utilities > .mwidget--rail .mwidget__railcontrols {
    flex: 0 0 auto;
    width: auto;
    padding: 0;
    gap: 4px;
  }

  .app3--home > .home-utilities > .mwidget--rail .np__btn,
  .app3--home > .home-utilities > .mwidget--rail .mwidget__pp.np__btn--play {
    width: 44px;
    height: 44px;
  }

  .app3--home > .home-utilities > .mlist {
    grid-column: 2;
    width: 100% !important;
    height: 64px !important;
    min-width: 0 !important;
    min-height: 64px !important;
    max-height: 64px !important;
    position: relative !important;
    inset: auto !important;
    margin: 0 !important;
    padding: 0 8px 0 12px !important;
    overflow: visible !important;
    background: rgba(9, 12, 14, 0.78) !important;
    -webkit-backdrop-filter: blur(18px) saturate(135%);
    backdrop-filter: blur(18px) saturate(135%);
    box-shadow: none !important;
  }

  .app3--home > .home-utilities > .mlist:only-child {
    grid-column: 1 / -1;
  }

  .mlist--compact {
    display: flex !important;
    align-items: center;
    gap: 10px;
  }

  .mlist--compact .mlist__compact-copy {
    width: 76px;
    min-width: 76px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding-left: 2px;
  }

  .mlist--compact .mlist__compact-copy h3 {
    margin: 0;
    color: var(--text);
    font-size: 12px;
    font-weight: 750;
    line-height: 1.1;
  }

  .mlist--compact .mlist__compact-copy .cnt {
    color: var(--text-2);
    font-size: 10px;
    font-weight: 500;
    line-height: 1.15;
  }

  .mlist--compact .mlist__friends-row {
    min-width: 0;
    min-height: 52px;
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 6px 8px 6px 2px;
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-x: contain;
    scroll-padding-inline: 8px;
    scrollbar-width: none;
  }

  .mlist--compact .mlist__friends-row::-webkit-scrollbar { display: none; }

  .mlist--compact .home-friend {
    width: 44px;
    height: 44px;
    min-width: 44px;
    flex: 0 0 44px;
    display: grid;
    place-items: center;
    padding: 3px;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: var(--text);
    cursor: pointer;
    transition: background 150ms ease, transform 180ms cubic-bezier(.2,.8,.2,1);
  }

  .mlist--compact .home-friend:hover { background: rgba(255,255,255,0.08); }
  .mlist--compact .home-friend.is-chat-source { transform: translateY(2px) scale(1.04); }
  .mlist--compact .home-friend:focus-visible { outline: 2px solid #fff; outline-offset: 1px; }
  .mlist--compact .mlist__compact-empty { color: var(--muted); font-size: 11px; white-space: nowrap; }

  /* Home direct chat is positioned against the Home shell, not the viewport. */
  .chatdock--home {
    position: absolute;
    inset: 0;
    z-index: 160;
    display: block;
    pointer-events: none;
  }

  .home-chat-scrim {
    position: absolute;
    inset: 0;
    z-index: 0;
    border: 0;
    padding: 0;
    background: transparent;
    pointer-events: auto;
    cursor: default;
  }

  .chatdock--home .cwin--home {
    position: absolute;
    z-index: 2;
    min-width: 0;
    max-width: none;
    min-height: 0;
    pointer-events: auto;
  }

  .cwin--home {
    border: 1px solid rgba(255,255,255,0.22);
    border-radius: 14px;
    overflow: visible;
    background: rgba(7, 10, 13, 0.58);
    -webkit-backdrop-filter: blur(22px) saturate(145%);
    backdrop-filter: blur(22px) saturate(145%);
    box-shadow: 0 18px 46px rgba(0,0,0,0.48);
    animation: home-chat-enter 190ms cubic-bezier(.16,1,.3,1) both;
    transform-origin: 50% 0;
  }

  @keyframes home-chat-enter {
    from { opacity: 0; transform: translateY(-5px) scale(.975); }
    to { opacity: 1; transform: translateY(0) scale(1); }
  }

  .cwin--home:not(.cwin--expanded) { border-top-color: transparent; }

  .home-chat__contour {
    position: absolute;
    left: -1px;
    z-index: 4;
    overflow: visible;
    pointer-events: none;
  }

  .home-chat__membrane {
    fill: rgba(7, 10, 13, 0.58);
    stroke: none;
  }

  .home-chat__outline {
    fill: none;
    stroke: rgba(255,255,255,0.22);
    stroke-width: 1;
    stroke-linecap: round;
    stroke-linejoin: round;
    vector-effect: non-scaling-stroke;
  }

  .cwin--home .cwin__head {
    min-height: 56px;
    padding: 8px 9px 7px 12px;
    gap: 9px;
    border-bottom: 0;
    border-radius: 13px 13px 0 0;
    background: transparent;
    cursor: default;
  }

  .cwin--home .cwin__person {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1px;
  }

  .cwin--home .cwin__status {
    color: var(--text-2);
    font-size: 10.5px;
    white-space: nowrap;
  }

  .home-chat__join {
    min-width: 44px;
    min-height: 44px;
    padding: 0 12px;
    border: 1px solid transparent;
    border-radius: 9px;
    color: #fff;
    font-family: inherit;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
  }

  .home-chat__join--host { background: #d5364b; border-color: #f04b61; }
  .home-chat__join--watch { background: #2f67c9; border-color: #4b82e7; }

  .cwin--home .cwin__ic {
    width: 44px;
    height: 44px;
    border-radius: 9px;
  }

  .cwin--home .cwin__body {
    flex: 1 1 auto;
    height: auto;
    min-height: 0;
    overflow-y: auto;
    background: transparent;
  }

  .cwin--home .cwin__composer {
    border-top: 0;
    padding: 8px 9px 10px;
    background: rgba(4,6,8,0.18);
  }

  .cwin--home .cwin__composer input {
    height: 40px;
    background: rgba(5,8,10,0.62);
  }

  .cwin--home .cwin__send {
    width: 44px;
    height: 44px;
  }

  .chatdock--home.chatdock--expanded { z-index: 170; }

  .cwin--home.cwin--expanded {
    border-radius: 14px;
    border-color: rgba(255,255,255,0.22);
    animation: none;
  }

  .cwin--home.cwin--expanded .cwin__body { padding-inline: 4px; }

  @media (prefers-reduced-motion: reduce) {
    .cwin--home { animation: none; }
    .mlist--compact .home-friend { transition: none; }
  }
}

@media (min-width: 901px) and (max-width: 1024px) {
  .app3--home { grid-template-columns: 74px 222px minmax(0, 1fr); }
}

@media (min-width: 761px) and (max-width: 900px) {
  .app3--home { grid-template-columns: 66px 188px minmax(0, 1fr); }
  .app3--home > .home-utilities { grid-template-columns: 300px minmax(0, 1fr); }
  .app3--home > .rail { padding-inline: 0 !important; }

  .app3--home .chan .acts .wallet.compact .w--gems,
  .app3--home .chan .acts .wallet.compact .w--robux {
    display: flex !important;
  }

  .app3--home .chan .acts .wallet.compact .wchip {
    box-sizing: border-box;
    flex: 0 0 44px;
    width: 44px !important;
    min-width: 44px;
    padding: 0 !important;
  }
}

@media (min-width: 1201px) and (max-width: 1449px) {
  .app3--home {
    --home-utility-slot: clamp(0px, calc(100vw - 1210px), 240px);
    grid-template-columns: 74px 284px minmax(0, 1fr) var(--home-utility-slot);
    grid-template-areas:
      "rail utilities utilities utilities"
      "rail lives stage .";
  }
}

@media (min-width: 1450px) {
  .app3--home {
    --home-gap: 10px;
    --home-structure-border: 3px solid rgba(255, 255, 255, 0.18);
    display: grid;
    grid-template-columns: 74px 284px minmax(0, 1fr) 250px;
    grid-template-rows: minmax(0, 1fr);
    grid-template-areas: "rail lives stage utilities";
    gap: var(--home-gap);
    box-sizing: border-box;
    height: 100%;
    min-width: 0;
    min-height: 0;
    padding: 10px;
    overflow: hidden;
  }

  .app3--home > .rail { grid-area: rail; }
  .app3--home > .lives { grid-area: lives; }
  .app3--home > .stage { grid-area: stage; }
  .app3--home > .home-utilities { grid-area: utilities; }

  .app3--home > .rail,
  .app3--home > .lives,
  .app3--home > .stage > .chat,
  .app3--home > .home-utilities > .mwidget--rail,
  .app3--home > .home-utilities > .mlist {
    border: var(--home-structure-border) !important;
    border-radius: 14px !important;
    box-sizing: border-box;
  }

  .app3--home > .rail {
    width: auto !important;
    height: auto !important;
    margin: 0 !important;
    padding: 10px 0 !important;
    overflow: hidden !important;
  }

  .app3--home > .lives {
    width: auto !important;
    min-width: 0 !important;
    min-height: 0 !important;
    max-height: none !important;
    margin: 0 !important;
    overflow: hidden !important;
  }

  .app3--home > .stage {
    min-width: 0;
    min-height: 0;
    margin: 0 !important;
    padding: 0 !important;
    gap: 0 !important;
    overflow: hidden;
  }

  .app3--home > .stage > .chat {
    width: 100%;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
  }

  .app3--home > .home-utilities {
    display: flex;
    flex-direction: column;
    gap: var(--home-gap);
    min-width: 0;
    min-height: 0;
    overflow: hidden;
  }

  .app3--home > .home-utilities > .mwidget--rail {
    order: 1;
    width: 100% !important;
    min-width: 0 !important;
    min-height: 160px !important;
    margin: 0 !important;
    background: rgba(9, 12, 14, 0.78) !important;
    -webkit-backdrop-filter: blur(18px) saturate(135%);
    backdrop-filter: blur(18px) saturate(135%);
    box-shadow: none !important;
  }

  .app3--home > .home-utilities > .live-room-mini--dock {
    height: 160px !important;
    min-height: 160px !important;
    max-height: 160px !important;
  }

  .app3--home > .home-utilities > .mlist {
    order: 2;
    width: 100% !important;
    min-width: 0 !important;
    min-height: 0 !important;
    flex: 1 1 auto;
    position: relative !important;
    inset: auto !important;
    margin: 0 !important;
    padding: 14px 12px !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    background: rgba(9, 12, 14, 0.78) !important;
    -webkit-backdrop-filter: blur(18px) saturate(135%);
    backdrop-filter: blur(18px) saturate(135%);
    box-shadow: none !important;
  }

  .app3--home > .home-utilities > .mlist .mlist__head {
    position: sticky;
    top: -14px;
    z-index: 3;
    background: rgba(9, 12, 14, 0.96) !important;
  }
}

.live-room-mini--dock {
  position: relative;
  inset: auto;
  right: auto;
  bottom: auto;
  z-index: 1;
  width: 100%;
  max-width: none;
  min-width: 0;
  min-height: 160px;
  flex: 0 0 auto;
  flex-direction: row !important;
  align-items: center !important;
  gap: 6px !important;
  box-sizing: border-box;
  margin: 0;
  padding: 8px !important;
  border-radius: 22px;
  overflow: hidden !important;
  box-shadow: none;
}

@media (min-width: 1450px) {
  .app3--home > .home-utilities > .live-room-mini--dock {
    height: 160px !important;
    min-height: 160px !important;
    max-height: 160px !important;
  }
  .live-room-mini--dock .live-room-mini__person {
    width: 82px;
    min-width: 82px;
    flex-basis: 82px;
  }
}
