/* PSC interface changes, 24 Nov 2026 (Claude, for Ahmed 06:40). With psc-ui-v1.js.
   Undo: remove the two psc-ui-v1 lines from extensions/core/Loader/HomepageRouting.php. Nothing here applies inside the PSC app. */

/* 1. Phones: the sections strip slides away while reading down and returns on the way up. */
@media (max-width: 979.98px) {
  html:not([data-psc-view]):not(.psc-in-app) nav.psc-sections { position: sticky; top: 0; z-index: 40; transition: transform .22s ease; }
  html.psc-ui-strip-away:not([data-psc-view]):not(.psc-in-app) nav.psc-sections { transform: translateY(-110%); }
}
@media (prefers-reduced-motion: reduce) { nav.psc-sections { transition: none !important; } }

/* 2. Desktop: the side menu is the way around PSC; the strip is for phones. */
@media (min-width: 980px) {
  html:not([data-psc-view]):not(.psc-in-app) body:has(#elNavSecondary_1) nav.psc-sections { display: none; }
}

@media (max-width: 979.98px) {
  /* 3. Tap targets: at least 44 px to the finger, without making the rows taller. */
  html:not([data-psc-view]):not(.psc-in-app) :is(.psc-sections__inner > a, .psc-network__sites > a, .psc-network__brand, .psc-title-actions > a, .psc-title-actions > button, .ipsBreadcrumb a, .ipsTags__tag) { position: relative; }
  html:not([data-psc-view]):not(.psc-in-app) :is(.psc-sections__inner > a, .psc-network__sites > a, .psc-network__brand, .psc-title-actions > a, .psc-title-actions > button, .ipsBreadcrumb a, .ipsTags__tag)::after {
    content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 44px; transform: translateY(-50%);
  }
  html:not([data-psc-view]):not(.psc-in-app) .psc-title-actions > :is(a, button) { min-height: 36px; }

  /* 4. A topic: Save, Note, Flashcard and More in one row; Share and Follow open from More.
        Share and Follow keep their room closed from the first paint, so nothing jumps; if the script never runs they return after 7 s. */
  html:not([data-psc-view]):not(.psc-in-app) body[data-pageapp="forums"][data-pagecontroller="topic"] .ipsPageHeader__row > ul.ipsButtons {
    max-height: 0; overflow: hidden; visibility: hidden; margin-block: 0; padding-block: 0; animation: psc-ui-failsafe 1ms 7s forwards;
  }
  .psc-title-actions { flex-wrap: nowrap; }
  .psc-ui-more-panel { margin-top: 8px; padding: 10px; border: 1px solid var(--i-background_4, rgba(127,127,127,.35)); border-radius: 12px; background: var(--i-background_2, rgba(127,127,127,.12)); }
  .psc-ui-more-panel[hidden] { display: none; }
  .psc-ui-more-panel > ul.ipsButtons { display: flex; flex-direction: column; align-items: stretch; gap: 8px; margin: 0; padding: 0; list-style: none; }
  .psc-ui-more-panel > ul.ipsButtons > li { width: 100%; }
  .psc-ui-more-panel > ul.ipsButtons > li > * { width: 100%; justify-content: center; }
}
@keyframes psc-ui-failsafe { to { max-height: 400px; overflow: visible; visibility: visible; } }
.psc-ui-more { cursor: pointer; font: inherit; }

/* 5. "See all" on the forum home's For you row. */
.psc-home__head { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: .6rem; }
.psc-ui-see-all { margin-inline-start: auto; min-height: 44px; display: inline-flex; align-items: center; font-size: .9rem; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
