/* 222C — the public mobile shell shared by home, catalogue and the live room.
   The reference uses one quiet 56px bar, three 44px hit targets and a small
   horizontal channel rail. Desktop keeps the incumbent header. */

.mobile-header-actions,
.mobile-channel-tabs { display: none; }

@media (max-width: 1024px) {
  html, body { overflow-x: hidden; }

  body:not(.watch) header.top {
    position: sticky;
    top: 0;
    display: flex !important;
    flex-direction: column;
    z-index: 80;
    width: 100%;
    height: auto !important;
    min-height: 100px;
    margin: 0;
    padding: env(safe-area-inset-top) 0 0 !important;
    background: rgba(28, 23, 42, .96);
    color: #fff;
    border-bottom: 1px solid rgba(255,255,255,.12);
    backdrop-filter: blur(16px);
  }

  body:not(.watch) header.top .top-bar {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: 56px;
    align-items: center;
    width: 100%;
    max-width: none;
    height: 56px;
    min-height: 56px;
    margin: 0;
    padding: 0 16px;
    box-sizing: border-box;
    gap: 0;
    background: transparent;
    flex: 0 0 56px;
  }

  body:not(.watch) header.top .wordmark {
    position: static !important;
    grid-column: 1;
    grid-row: 1;
    justify-self: start;
    width: auto;
    min-width: 0;
    height: 44px;
    min-height: 44px;
    padding: 0;
    transform: none !important;
    color: #fff;
    font: 800 22px/1 "Inter Variable", "ROAN Noto SC", sans-serif;
    letter-spacing: .08em;
    text-indent: 0;
  }

  body:not(.watch) header.top .primary-nav,
  body:not(.watch) header.top .top-left,
  body:not(.watch) header.top .top-right,
  body:not(.watch) header.top .tabs,
  body:not(.watch) header.top .home-mobile-search-toggle,
  body:not(.watch) header.top .desktop-discovery { display: none !important; }

  .mobile-header-actions {
    grid-column: 2;
    grid-row: 1;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0;
    width: 132px;
    height: 56px;
  }

  .mobile-header-action {
    position: relative;
    display: inline-grid;
    place-items: center;
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: #fff;
    cursor: pointer;
    text-decoration: none;
  }

  .mobile-header-action svg { width: 24px; height: 24px; stroke-width: 2; }
  .mobile-header-favorite[aria-pressed="true"] { color: #c994ff; }
  .mobile-header-favorite[aria-pressed="true"] svg { fill: currentColor; }
  .mobile-header-action:focus-visible { outline: 2px solid #c994ff; outline-offset: -2px; }
  .mobile-header-cart .bag-count {
    position: absolute;
    top: 4px;
    right: 1px;
    display: grid;
    place-items: center;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    box-sizing: border-box;
    border-radius: 999px;
    background: #a357ff;
    color: #fff;
    font: 700 11px/1 "Inter Variable", sans-serif;
    font-variant-numeric: tabular-nums;
  }
  .mobile-header-cart .bag-count:empty { display: none; }

  .mobile-channel-tabs {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    align-items: stretch;
    gap: 0;
    width: 100%;
    max-width: none;
    min-height: 44px;
    padding: 0 16px;
    box-sizing: border-box;
    overflow-x: hidden;
    overflow-y: hidden;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    background: #1c172a;
  }
  .mobile-channel-tabs::-webkit-scrollbar { display: none; }
  .mobile-channel-tabs a {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    min-height: 44px;
    margin-right: 0;
    padding: 0 3px;
    color: rgba(255,255,255,.7);
    font-size: 13px;
    line-height: 1.15;
    text-align: center;
    white-space: normal;
    overflow-wrap: anywhere;
    text-decoration: none;
  }
  .mobile-channel-tabs a[aria-current="page"] { color: #fff; font-weight: 750; }
  .mobile-channel-tabs a[aria-current="page"]::after {
    content: "";
    position: absolute;
    right: 0;
    bottom: 5px;
    left: 0;
    height: 3px;
    border-radius: 99px;
    background: #a357ff;
  }

  body:not(.watch) header.top.is-search-open .top-bar {
    grid-template-rows: 56px 52px;
    height: 108px;
  }
  body:not(.watch) header.top.is-search-open .top-left {
    display: block !important;
    position: absolute;
    z-index: 2;
    top: 56px;
    right: 16px;
    left: 16px;
    height: 52px;
  }
  body:not(.watch) header.top.is-search-open .header-search,
  body:not(.watch) header.top.is-search-open .platform-search { display: flex !important; width: 100%; height: 44px; }
  body:not(.watch) header.top.is-search-open .header-search input,
  body:not(.watch) header.top.is-search-open .platform-search input {
    width: 100%;
    height: 44px;
    min-height: 44px;
    box-sizing: border-box;
    padding: 0 16px;
    border: 1px solid #8e64d6;
    border-radius: 999px;
    background: #fff;
    color: #1d1729;
    font-size: 15px;
  }

  /* The homepage's 212C canvas is light below the dark public shell. */
  body.home-159-shell header.top { background: rgba(28,23,42,.96); }
  body.home-159-shell .mobile-channel-tabs { background: #1c172a; }
  /* The homepage has an older language/search shell that is still hydrated for
     desktop. Keep it out of the compact row so the three shared controls cannot
     be covered by a fourth control. */
  body.home-159-shell header.top .top-right,
  body.home-159-shell header.top .home-mobile-search-toggle,
  body.home-159-shell header.top .top-bar > .lang-switch { display: none !important; visibility: hidden !important; }
  body.home-159-shell header.top .top-bar > .platform-search { display: none !important; }
  /* The homepage uses the bound room-search form. Never expose the legacy
     query form behind it or focus its keyboard-submit path on phones. */
  body.home-159-shell header.top.is-search-open .top-left { display: none !important; }
  body.home-159-shell header.top.is-search-open .top-bar > .platform-search {
    position: absolute;
    z-index: 2;
    top: 56px;
    right: 16px;
    left: 16px;
    display: block !important;
    height: 52px;
  }
  body.home-159-shell header.top.is-search-open .top-bar > .platform-search .platform-search-form {
    display: flex !important;
    width: 100%;
    height: 44px;
  }
  body.home-159-shell header.top.is-search-open { min-height: 152px; }

  /* The live room retains its dark stage while exposing the same public shell. */
  body.watch {
    position: fixed;
    inset: 0;
    overflow: hidden;
    background: #17121f;
  }
  body.watch .watch-head {
    position: relative;
    z-index: 90;
    display: flex !important;
    flex-direction: column;
    height: auto !important;
    min-height: 100px;
    padding: 0;
    background: #1c172a;
    border: 0;
  }
  body.watch .watch-head .top-bar {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: 56px;
    align-items: center;
    width: 100%;
    max-width: none;
    height: 56px;
    min-height: 56px;
    padding: 0 16px;
    box-sizing: border-box;
    flex: 0 0 56px;
  }
  body.watch .watch-head .wordmark {
    position: static !important;
    grid-column: 1;
    grid-row: 1;
    justify-self: start;
    width: auto;
    min-width: 0;
    height: 44px;
    min-height: 44px;
    padding: 0;
    transform: none !important;
    color: #fff;
    font: 800 22px/1 "Inter Variable", sans-serif;
    letter-spacing: .08em;
    text-indent: 0;
  }
  body.watch .watch-head .primary-nav,
  body.watch .watch-head .top-left,
  body.watch .watch-head .top-right,
  body.watch .watch-head .tabs { display: none !important; }
  body.watch .watch-head .mobile-header-actions { grid-column: 2; grid-row: 1; }
  body.watch .watch-head .mobile-channel-tabs { background: #1c172a; }
  body.watch .watch-head .mobile-header-action { color: #fff; }
  body.watch .stage-wrap { top: 100px; inset-inline: 0; bottom: 0; height: auto; }
}

@media (prefers-reduced-motion: reduce) {
  .mobile-channel-tabs, .mobile-header-action { scroll-behavior: auto; transition: none !important; }
}
