/* ============================================================
   Fabavio settings hub — Instagram-style "Settings and activity"
   drawer (mobile only). Rebuilt 2026-09-28 per Fabian.
   Dark theme (#0A0A0C) with Fabavio violet (#7C3CFF) accents.
   ============================================================ */
@media (max-width: 767.98px) {

  .qm-backdrop {
    position: fixed;
    inset: 0;
    z-index: 3000; /* 2026-09-28: above reels/live chrome (2065) + modals, below 99999 toasts */
    background: rgba(0, 0, 0, .6);
    opacity: 0;
    transition: opacity .25s ease;
  }
  .qm-backdrop[hidden] { display: none; }
  .qm-backdrop.show { opacity: 1; }

  .qm-drawer {
    position: fixed;
    top: 0; right: 0; bottom: 0;
    z-index: 3050;
    width: min(88vw, 360px);
    background: #0A0A0C;
    border-left: 1px solid rgba(255, 255, 255, .08);
    transform: translateX(102%);
    transition: transform .28s cubic-bezier(.32, .72, .35, 1);
    display: flex;
    flex-direction: column;
    box-shadow: -12px 0 40px rgba(0, 0, 0, .55);
  }
  .qm-drawer[hidden] { display: none; }
  .qm-drawer.open { transform: none; }

  /* Header: title + close */
  .qm-head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: calc(16px + env(safe-area-inset-top)) 8px 12px 18px;
    flex-shrink: 0;
  }
  .qm-title {
    flex: 1;
    font-size: 21px;
    font-weight: 700;
    color: #fff;
    letter-spacing: -.2px;
  }
  .qm-close {
    width: 40px; height: 40px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: #fff;
    cursor: pointer;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .qm-close:active { background: #1C1C22; transform: scale(.92); }
  .qm-close .ion-icon-wrapper svg { width: 26px; height: 26px; }

  /* Search */
  .qm-searchwrap {
    position: relative;
    margin: 0 16px 6px;
    flex-shrink: 0;
  }
  .qm-search-ico {
    position: absolute;
    left: 12px; top: 50%;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, .45);
    pointer-events: none;
    display: flex;
  }
  .qm-search-ico .ion-icon-wrapper svg { width: 18px; height: 18px; }
  .qm-search {
    width: 100%;
    height: 42px;
    border: none;
    border-radius: 12px;
    background: #1C1C22;
    color: #fff;
    font-size: 15px;
    padding: 0 14px 0 38px;
    box-sizing: border-box;
    outline: none;
  }
  .qm-search::placeholder { color: rgba(255, 255, 255, .45); }
  .qm-search:focus { box-shadow: 0 0 0 2px rgba(124, 60, 255, .55); }
  .qm-search::-webkit-search-cancel-button { filter: invert(1); opacity: .5; }

  /* Scroll area */
  .qm-scroll {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    padding: 2px 0 calc(24px + env(safe-area-inset-bottom));
  }

  /* Sections: divider + small gray header (Instagram density) */
  .qm-section { padding: 2px 0 4px; }
  .qm-section + .qm-section { border-top: 1px solid rgba(255, 255, 255, .07); }
  .qm-sec-title {
    font-size: 13.5px;
    font-weight: 400;
    color: rgba(255, 255, 255, .55);
    padding: 16px 18px 4px;
  }

  /* Rows: icon + label + chevron */
  .qm-row {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    min-height: 54px;
    padding: 7px 18px;
    box-sizing: border-box;
    background: none;
    border: none;
    color: #fff;
    text-decoration: none;
    font-size: 16px;
    font-weight: 400;
    font-family: inherit;
    text-align: left;
    cursor: pointer;
  }
  .qm-row:active { background: #16161C; }
  .qm-row[hidden] { display: none; }
  .qm-ico {
    width: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #fff;
  }
  .qm-ico .ion-icon-wrapper svg { width: 26px; height: 26px; }
  .qm-lbl { flex: 1; line-height: 1.25; }
  .qm-sub {
    display: block;
    font-size: 12.5px;
    font-weight: 400;
    color: rgba(255, 255, 255, .5);
    margin-top: 1px;
  }
  .qm-chev {
    color: rgba(255, 255, 255, .35);
    display: flex;
    flex-shrink: 0;
  }
  .qm-chev .ion-icon-wrapper svg { width: 20px; height: 20px; }
  .qm-check {
    color: #7C3CFF;
    display: flex;
    flex-shrink: 0;
  }
  .qm-check .ion-icon-wrapper svg { width: 22px; height: 22px; }

  /* Language sub-list */
  .qm-lang-list { padding: 2px 0 4px; }
  .qm-lang-list[hidden] { display: none; }
  .qm-lang-row { min-height: 48px; padding-left: 60px; font-size: 15px; }
  #qm-lang-toggle .qm-chev { transition: transform .2s ease; }
  #qm-lang-toggle[aria-expanded="true"] .qm-chev { transform: rotate(90deg); }

  /* Logout row: red label, no chevron */
  .qm-logout .qm-lbl { color: #FF453A; font-weight: 400; }
  .qm-logout-form { margin: 0; }

  /* Search: hide empty sections */
  .qm-section.qm-hidden { display: none; }
  .qm-no-results {
    padding: 32px 24px;
    text-align: center;
    color: rgba(255, 255, 255, .5);
    font-size: 15px;
  }
  .qm-no-results[hidden] { display: none; }
}
/* ============================================================
   YouTube-home 2026-09-28: the homepage opens the settings hub
   below 1024px (its desktop sidebar only exists >=1024px). This
   band re-declares the drawer styles scoped to the homepage so
   other pages keep their mobile-only behavior untouched.
   ============================================================ */
@media (min-width: 768px) and (max-width: 1023.98px) {

  body:has(.yt-home) .qm-backdrop {
    position: fixed;
    inset: 0;
    z-index: 3000; /* 2026-09-28: above reels/live chrome (2065) + modals, below 99999 toasts */
    background: rgba(0, 0, 0, .6);
    opacity: 0;
    transition: opacity .25s ease;
  }
  body:has(.yt-home) .qm-backdrop[hidden] { display: none; }
  body:has(.yt-home) .qm-backdrop.show { opacity: 1; }

  body:has(.yt-home) .qm-drawer {
    position: fixed;
    top: 0; right: 0; bottom: 0;
    z-index: 3050;
    width: min(88vw, 360px);
    background: #0A0A0C;
    border-left: 1px solid rgba(255, 255, 255, .08);
    transform: translateX(102%);
    transition: transform .28s cubic-bezier(.32, .72, .35, 1);
    display: flex;
    flex-direction: column;
    box-shadow: -12px 0 40px rgba(0, 0, 0, .55);
  }
  body:has(.yt-home) .qm-drawer[hidden] { display: none; }
  body:has(.yt-home) .qm-drawer.open { transform: none; }

  /* Header: title + close */
  body:has(.yt-home) .qm-head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: calc(16px + env(safe-area-inset-top)) 8px 12px 18px;
    flex-shrink: 0;
  }
  body:has(.yt-home) .qm-title {
    flex: 1;
    font-size: 21px;
    font-weight: 700;
    color: #fff;
    letter-spacing: -.2px;
  }
  body:has(.yt-home) .qm-close {
    width: 40px; height: 40px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: #fff;
    cursor: pointer;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  body:has(.yt-home) .qm-close:active { background: #1C1C22; transform: scale(.92); }
  body:has(.yt-home) .qm-close .ion-icon-wrapper svg { width: 26px; height: 26px; }

  /* Search */
  body:has(.yt-home) .qm-searchwrap {
    position: relative;
    margin: 0 16px 6px;
    flex-shrink: 0;
  }
  body:has(.yt-home) .qm-search-ico {
    position: absolute;
    left: 12px; top: 50%;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, .45);
    pointer-events: none;
    display: flex;
  }
  body:has(.yt-home) .qm-search-ico .ion-icon-wrapper svg { width: 18px; height: 18px; }
  body:has(.yt-home) .qm-search {
    width: 100%;
    height: 42px;
    border: none;
    border-radius: 12px;
    background: #1C1C22;
    color: #fff;
    font-size: 15px;
    padding: 0 14px 0 38px;
    box-sizing: border-box;
    outline: none;
  }
  body:has(.yt-home) .qm-search::placeholder { color: rgba(255, 255, 255, .45); }
  body:has(.yt-home) .qm-search:focus { box-shadow: 0 0 0 2px rgba(124, 60, 255, .55); }
  body:has(.yt-home) .qm-search::-webkit-search-cancel-button { filter: invert(1); opacity: .5; }

  /* Scroll area */
  body:has(.yt-home) .qm-scroll {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    padding: 2px 0 calc(24px + env(safe-area-inset-bottom));
  }

  /* Sections: divider + small gray header (Instagram density) */
  body:has(.yt-home) .qm-section { padding: 2px 0 4px; }
  body:has(.yt-home) .qm-section + .qm-section { border-top: 1px solid rgba(255, 255, 255, .07); }
  body:has(.yt-home) .qm-sec-title {
    font-size: 13.5px;
    font-weight: 400;
    color: rgba(255, 255, 255, .55);
    padding: 16px 18px 4px;
  }

  /* Rows: icon + label + chevron */
  body:has(.yt-home) .qm-row {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    min-height: 54px;
    padding: 7px 18px;
    box-sizing: border-box;
    background: none;
    border: none;
    color: #fff;
    text-decoration: none;
    font-size: 16px;
    font-weight: 400;
    font-family: inherit;
    text-align: left;
    cursor: pointer;
  }
  body:has(.yt-home) .qm-row:active { background: #16161C; }
  body:has(.yt-home) .qm-row[hidden] { display: none; }
  body:has(.yt-home) .qm-ico {
    width: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #fff;
  }
  body:has(.yt-home) .qm-ico .ion-icon-wrapper svg { width: 26px; height: 26px; }
  body:has(.yt-home) .qm-lbl { flex: 1; line-height: 1.25; }
  body:has(.yt-home) .qm-sub {
    display: block;
    font-size: 12.5px;
    font-weight: 400;
    color: rgba(255, 255, 255, .5);
    margin-top: 1px;
  }
  body:has(.yt-home) .qm-chev {
    color: rgba(255, 255, 255, .35);
    display: flex;
    flex-shrink: 0;
  }
  body:has(.yt-home) .qm-chev .ion-icon-wrapper svg { width: 20px; height: 20px; }
  body:has(.yt-home) .qm-check {
    color: #7C3CFF;
    display: flex;
    flex-shrink: 0;
  }
  body:has(.yt-home) .qm-check .ion-icon-wrapper svg { width: 22px; height: 22px; }

  /* Language sub-list */
  body:has(.yt-home) .qm-lang-list { padding: 2px 0 4px; }
  body:has(.yt-home) .qm-lang-list[hidden] { display: none; }
  body:has(.yt-home) .qm-lang-row { min-height: 48px; padding-left: 60px; font-size: 15px; }
  body:has(.yt-home) #qm-lang-toggle .qm-chev { transition: transform .2s ease; }
  body:has(.yt-home) #qm-lang-toggle[aria-expanded="true"] .qm-chev { transform: rotate(90deg); }

  /* Logout row: red label, no chevron */
  body:has(.yt-home) .qm-logout .qm-lbl { color: #FF453A; font-weight: 400; }
  body:has(.yt-home) .qm-logout-form { margin: 0; }

  /* Search: hide empty sections */
  body:has(.yt-home) .qm-section.qm-hidden { display: none; }
  body:has(.yt-home) .qm-no-results {
    padding: 32px 24px;
    text-align: center;
    color: rgba(255, 255, 255, .5);
    font-size: 15px;
  }
  body:has(.yt-home) .qm-no-results[hidden] { display: none; }
}

/* Go Live button with blinking red dot (2026-10-09, per Fabian) */
@keyframes go-live-blink {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(0.85); }
}
.qm-go-live, .yt-go-live {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    margin: 8px 12px;
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    border-radius: 12px;
    color: #fff !important;
    font-weight: 700;
    font-size: 16px;
    text-decoration: none;
    box-shadow: 0 2px 12px rgba(220, 38, 38, 0.4);
}
.qm-go-live:hover, .yt-go-live:hover {
    color: #fff !important;
    text-decoration: none;
    filter: brightness(1.1);
}
.qm-go-live-dot, .yt-go-live-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #fff;
    flex-shrink: 0;
    animation: go-live-blink 1.2s ease-in-out infinite;
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.8);
}
.qm-go-live-label, .yt-go-live-label {
    color: #fff;
}
