/* PSC early layout v1 (Claude, 20 Nov 2026; Ahmed 19 Nov 22:46: "check for flicker on all psc website pages invision videos
   app"). In the page's head (the pscfeatures Loader's css()), so it is here before the page first draws. psc-site.js adds some
   parts a moment after that first draw; each rule below keeps the room such a part will take and stops by itself the moment the
   part is in place, so nothing on the page jumps when it arrives. The sizes are the parts' own, in rem, so they follow the
   reader's text size. Website rules leave out the PSC app (data-psc-view, set by the app before a page draws, or psc-in-app). */

@media screen {
  /* 1. The sections row (Search, Forums, Videos …) goes between the PSC bar and the page, on every page of the website. */
  html:not([data-psc-view]):not(.psc-in-app) body > nav.psc-network + #ipsLayout { margin-top: calc(2.7425rem + 1px); }

  /* 2. A topic's own tags (Video, Interesting case …) go right under its title once PSC says what the topic is. Plain
        discussions have none, so their titles keep the little room. Website and app. */
  body[data-pageapp="forums"][data-pagecontroller="topic"] .ipsPageHeader__title > h1 { display: block; }
  body[data-pageapp="forums"][data-pagecontroller="topic"] .ipsPageHeader__title > h1:not(:has(+ .psc-tags))::after {
    content: ""; display: block; block-size: calc(1.12rem + 2px); margin: .3rem 0 .1rem;
  }

  /* 3. Save, Add a note and Make a flashcard under a topic's title, for members (website). */
  html:not([data-ips-guest]):not([data-psc-view]):not(.psc-in-app) body[data-pageapp="forums"][data-pagecontroller="topic"] header.ipsPageHeader .ipsPageHeader__title:not(:has(> .psc-title-actions))::after {
    content: ""; display: block; box-sizing: content-box; block-size: 1.75rem; margin: calc(.4rem - 4px) -4px -4px; padding: 4px;
  }

  /* 4. The forum home's box: Continue where you left off, For you and the collections for you, one row of cards (website). */
  html:not([data-psc-view]):not(.psc-in-app) body[data-pageapp="forums"][data-pagemodule="forums"][data-pagecontroller="index"] .ipsLayout__primary-column > header.ipsPageHeader--forum-table + section:not(.psc-v43)::before {
    content: ""; display: block; block-size: calc(13.75rem + 2px);
  }

  /* 5. Extra's pages draw their view when its words arrive: the room under its menu is kept, so the page's foot stays below. */
  #psc-view.psc-view { min-block-size: 100vh; }
}

/* The row under a page's title: Save, Add a note, Make a flashcard (psc-site.js v63 puts them in it). One line, always the same
   height; on a narrow phone it scrolls sideways if it must. The 4px padding keeps the buttons' focus rings in view. */
.ipsPageHeader__title .psc-title-actions {
  display: flex; flex-wrap: nowrap; align-items: center; gap: .5rem; box-sizing: content-box; block-size: 1.75rem;
  margin: calc(.4rem - 4px) -4px -4px; padding: 4px; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; line-height: 1.25;
}
.ipsPageHeader__title .psc-title-actions::-webkit-scrollbar { display: none; }
.ipsPageHeader__title .psc-title-actions > .psc-heart,
.ipsPageHeader__title .psc-title-actions > .psc-note-link { flex: none; box-sizing: border-box; block-size: 1.75rem; margin: 0 !important; white-space: nowrap; }
.ipsPageHeader__title .psc-title-actions:empty { display: none; }
/* Its status line (Saved, Removed …) takes no room until it has something to say, so the row's room is the same before and after. */
.ipsPageHeader__title > .psc-heart__note:empty { margin: 0 !important; }
@media (max-width: 30em) {
  .ipsPageHeader__title .psc-title-actions > .psc-heart,
  .ipsPageHeader__title .psc-title-actions > .psc-note-link { font-size: .8rem !important; padding-inline: .65rem !important; }
}

/* The forum home's box (drawn by psc-site.js, the v43 part): always calc(12.75rem + 2px) high, so the room kept above (4.) is
   exactly its own with its 1rem below. */
.psc-home.psc-v43 {
  display: flex; flex-direction: column; gap: .75rem; box-sizing: border-box; block-size: calc(12.75rem + 2px); margin: 0 0 1rem;
  padding: 1rem 1.15rem; overflow: hidden;
}
.psc-home .psc-home__head { display: flex; align-items: baseline; gap: .75rem; flex: none; block-size: 1.5rem; min-inline-size: 0; overflow: hidden; white-space: nowrap; }
.psc-home .psc-home__head h2 { flex: none; margin: 0; font-size: 1.15rem; line-height: 1.5rem; }
.psc-home .psc-home__note { min-inline-size: 0; margin: 0; overflow: hidden; text-overflow: ellipsis; font-size: .9rem; line-height: 1.5rem; color: var(--i-color_soft, #486063); }
.psc-home .psc-home__frame { position: relative; flex: none; block-size: 8.5rem; min-inline-size: 0; }
.psc-home .psc-home__strip {
  display: flex; gap: .75rem; block-size: 100%; margin: 0; padding: 0; list-style: none; overflow-x: auto; overflow-y: hidden;
  scroll-snap-type: x proximity; scrollbar-width: none; overscroll-behavior-x: contain;
}
.psc-home .psc-home__strip::-webkit-scrollbar { display: none; }
.psc-home .psc-home__item { flex: 0 0 min(15rem, 80%); block-size: 100%; margin: 0; padding: 0; scroll-snap-align: start; }
.psc-home .psc-home__card {
  display: flex; flex-direction: column; gap: .35rem; box-sizing: border-box; block-size: 100%; padding: .7rem .8rem; overflow: hidden;
  border: 1px solid var(--i-box--bo-co, #d9e1dc); border-radius: .8rem; background: rgba(127, 127, 127, .06); color: inherit; text-decoration: none;
}
.psc-home a.psc-home__card:hover { border-color: var(--i-primary, #175358); text-decoration: none; }
.psc-home a.psc-home__card:focus-visible { outline: 2px solid var(--i-primary, #2f8f7a); outline-offset: -2px; }
.psc-home .psc-home__top { display: flex; align-items: center; gap: .45rem; flex: none; block-size: 1.25rem; min-inline-size: 0; overflow: hidden; white-space: nowrap; }
.psc-home .psc-home__top .psc-v43-chip { line-height: calc(1.25rem - 4px); }
.psc-home .psc-home__label { font-size: .75rem; font-weight: 700; color: var(--i-primary, #175358); }
html[data-ips-scheme-active="dark"] .psc-home .psc-home__label { color: var(--i-link--co, #9ce6cf); }
.psc-home .psc-home__title {
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; flex: 1 1 auto; min-block-size: 0; overflow: hidden;
  font-size: .95rem; font-weight: 600; line-height: 1.3; overflow-wrap: anywhere;
}
.psc-home .psc-home__meta { flex: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .8rem; line-height: 1.2rem; color: var(--i-color_soft, #486063); }
.psc-home .psc-home__item--empty .psc-home__card { justify-content: center; font-size: .9rem; color: var(--i-color_soft, #486063); }
.psc-home .psc-home__bar { display: block; flex: none; block-size: .8rem; border-radius: 999px; background: rgba(127, 127, 127, .2); }
.psc-home .psc-home__bar--chip { inline-size: 4.5rem; block-size: 1.1rem; margin-block-end: .15rem; }
.psc-home .psc-home__bar--line { inline-size: 92%; }
.psc-home .psc-home__bar--short { inline-size: 60%; }
.psc-home .psc-home__bar--meta { inline-size: 45%; block-size: .65rem; margin-block-start: auto; }
@media (prefers-reduced-motion: no-preference) {
  .psc-home .psc-home__item--wait .psc-home__card { animation: psc-home-wait 1.2s ease-in-out infinite alternate; }
  @keyframes psc-home-wait { from { opacity: 1; } to { opacity: .55; } }
}
.psc-home .psc-home__arrow {
  position: absolute; top: 50%; z-index: 2; display: flex; align-items: center; justify-content: center; inline-size: 2.2rem; block-size: 2.2rem;
  margin-block-start: -1.1rem; padding: 0; border: 1px solid var(--i-box--bo-co, #d9e1dc); border-radius: 50%; cursor: pointer;
  background: var(--i-box--ba-co, #fff); color: var(--i-color_hard, inherit); box-shadow: 0 2px 8px rgba(0, 0, 0, .25);
}
.psc-home .psc-home__arrow--prev { left: -.35rem; }
.psc-home .psc-home__arrow--next { right: -.35rem; }
.psc-home .psc-home__arrow[hidden] { display: none; }
@media (hover: none) { .psc-home .psc-home__arrow { display: none !important; } }
@media print { .psc-home { display: none !important; } }
