
/*
  VW Watch Together
  Host Portal Mobile Responsive Fix V2.3R1M1
  Scope: /watch/host/ only
*/

html,
body {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

body {
  min-width: 0;
}

.host-shell,
.host-header,
.host-brand,
.header-actions,
.dashboard,
.dash-top,
.card,
.rooms-section,
.section-head,
.room-list,
.room-card,
.room-card-head,
.room-card-title,
.room-meta,
.room-actions,
.share-panel,
.share-default,
.person-link-form,
.create-grid,
.form-actions,
.password-form,
.password-actions {
  min-width: 0;
  max-width: 100%;
}

.host-shell *,
.host-shell *::before,
.host-shell *::after {
  box-sizing: border-box;
}

.host-shell input,
.host-shell select,
.host-shell button,
.host-shell textarea {
  min-width: 0;
  max-width: 100%;
}

.room-card-title b,
.room-card-title small,
.dash-top p,
.section-head small,
.room-current,
.privacy-note,
.security-note {
  overflow-wrap: anywhere;
}

@media (max-width: 760px) {
  .host-shell {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 10px 12px 34px !important;
  }

  .host-header {
    width: 100%;
    padding: 7px 0 15px !important;
    gap: 10px;
  }

  .host-brand {
    flex: 1 1 auto;
    overflow: hidden;
  }

  .host-brand > div {
    min-width: 0;
  }

  .host-brand b {
    font-size: 17px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .host-brand small {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .header-actions {
    flex: 0 0 auto;
  }

  .header-actions .ghost,
  #hostLock {
    width: auto !important;
    min-width: 70px;
    padding-inline: 12px;
  }

  .dashboard {
    width: 100%;
    gap: 12px;
  }

  .dash-top {
    width: 100%;
    padding: 10px 0 3px !important;
    gap: 13px !important;
    align-items: stretch !important;
  }

  .dash-top > div {
    min-width: 0;
    width: 100%;
  }

  .dash-top h1 {
    max-width: 100%;
    font-size: clamp(29px, 9vw, 38px) !important;
    line-height: 1.04;
    overflow-wrap: anywhere;
  }

  .dash-top p {
    width: 100%;
    max-width: 100%;
    margin-right: 0;
    line-height: 1.55;
  }

  .dash-top > button,
  #newRoomToggle {
    width: 100% !important;
    max-width: 100% !important;
    min-height: 48px;
  }

  .card {
    width: 100%;
    max-width: 100%;
    padding: 12px !important;
    border-radius: 16px !important;
  }

  .new-room.card,
  .rooms-section.card,
  .security.card {
    overflow: hidden;
  }

  .section-head {
    width: 100%;
    align-items: flex-start !important;
    flex-wrap: wrap;
    gap: 8px !important;
  }

  .section-head > div {
    min-width: 0;
    flex: 1 1 190px;
  }

  .section-head > button {
    flex: 0 0 auto;
    max-width: 100%;
  }

  .create-grid {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .create-grid .wide {
    grid-column: 1 !important;
  }

  .form-actions {
    width: 100%;
    flex-direction: column;
    align-items: stretch !important;
  }

  .form-actions .primary {
    width: 100%;
  }

  .stats {
    width: 100%;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px !important;
  }

  .stats > div {
    min-width: 0;
    padding: 12px !important;
  }

  .stats small,
  .stats b {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .room-list {
    width: 100%;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 10px !important;
  }

  .room-card {
    width: 100%;
    max-width: 100%;
    padding: 12px !important;
    gap: 10px !important;
    overflow: hidden;
  }

  .room-card-head {
    width: 100%;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: 8px;
  }

  .room-card-title {
    width: 100%;
    min-width: 0;
  }

  .room-card-title b {
    font-size: 17px;
    line-height: 1.15;
  }

  .room-card-title small {
    width: 100%;
    max-width: 100%;
    margin-top: 3px;
    font-size: 10.5px;
  }

  .room-code {
    min-width: 0;
    max-width: 82px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .room-meta {
    width: 100%;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 6px !important;
  }

  .room-meta span {
    min-width: 0;
    width: 100%;
    padding: 8px 5px !important;
    text-align: center;
    white-space: normal;
    overflow-wrap: anywhere;
    line-height: 1.2;
    font-size: 10px !important;
  }

  .room-current {
    width: 100%;
    line-height: 1.35;
  }

  .room-actions {
    width: 100%;
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px !important;
  }

  .room-actions button {
    width: 100%;
    min-width: 0 !important;
    min-height: 42px !important;
    padding: 9px 7px !important;
    font-size: 11px !important;
    line-height: 1.2;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  /* Primary action receives the full first row.
     Copy viewer + Share access sit safely below it. */
  .room-actions button:first-child {
    grid-column: 1 / -1;
    min-height: 44px !important;
    background: linear-gradient(135deg, rgba(22,142,243,.18), rgba(90,94,234,.14));
    border-color: rgba(82,132,255,.27);
  }

  .share-panel {
    left: 10px !important;
    right: 10px !important;
    bottom: 10px !important;
    width: auto !important;
    max-width: none !important;
    max-height: calc(100dvh - 20px);
    overflow-y: auto;
    overflow-x: hidden;
    padding-bottom: max(14px, env(safe-area-inset-bottom));
  }

  .share-default {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 9px !important;
  }

  .share-default > div {
    min-width: 0;
  }

  .person-link-form {
    width: 100%;
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .person-link-form button {
    width: 100%;
  }

  .password-form {
    width: 100%;
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .password-actions {
    width: 100%;
    flex-direction: column !important;
    align-items: stretch !important;
  }

  .password-actions > * {
    width: 100%;
  }

  .toast {
    width: max-content;
    max-width: calc(100% - 24px);
    text-align: center;
  }
}

@media (max-width: 430px) {
  .host-shell {
    padding-left: 10px !important;
    padding-right: 10px !important;
  }

  .host-mark {
    width: 34px !important;
    height: 34px !important;
    border-radius: 11px !important;
  }

  .host-brand b {
    font-size: 16px;
  }

  .host-brand small {
    font-size: 9px !important;
  }

  .header-actions .ghost,
  #hostLock {
    min-width: 64px;
    min-height: 40px;
    padding-inline: 9px;
  }

  .dash-top h1 {
    font-size: clamp(28px, 9.5vw, 34px) !important;
  }

  .stats > div {
    padding: 10px !important;
  }

  .stats b {
    font-size: 19px !important;
  }

  .rooms-section.card {
    padding: 10px !important;
  }

  .room-card {
    padding: 11px !important;
    border-radius: 13px !important;
  }

  .room-meta {
    gap: 5px !important;
  }

  .room-meta span {
    padding: 7px 3px !important;
    font-size: 9.5px !important;
  }

  .room-actions {
    gap: 7px !important;
  }

  .room-actions button {
    padding-inline: 5px !important;
    font-size: 10.5px !important;
  }

  .section-head > button,
  #refreshRooms {
    max-width: 100%;
  }
}

@media (max-width: 340px) {
  .room-meta {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .room-meta span:last-child {
    grid-column: 1 / -1;
  }

  .room-actions {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .room-actions button:first-child {
    grid-column: 1;
  }
}

/* VW_WATCH_TOGETHER_HOST_PORTAL_MOBILE_RESPONSIVE_FIX_V2_3R1M1 */
