/* PSC Videos: the library and video page in the approved design (Claude, 19 Nov 2026). Styles for psc-library-v1.js. It uses the
   page's own colour variables, so it follows the light and dark themes styles.css already has. */

/* ---- Hero */
html.psc-library-v1 .button-hero { display: none; }
/* "Every PSC video," stays on one line beside the photograph. */
html.psc-library-v1 #hero-title { font-size: clamp(46px, 5.3vw, 80px); line-height: .98; }
.psc-hero-search {
  display: flex; align-items: center; gap: 8px; width: min(100%, 580px); margin: 26px 0 0; padding: 6px 6px 6px 14px;
  border: 1px solid rgba(255, 255, 255, .32); border-radius: 14px; background: rgba(8, 28, 30, .55);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); box-shadow: 0 12px 34px rgba(0, 0, 0, .25);
}
.psc-hero-search:focus-within { border-color: #c5e9d1; box-shadow: 0 0 0 3px rgba(197, 233, 209, .3), 0 12px 34px rgba(0, 0, 0, .25); }
.psc-hero-search-icon { flex: none; width: 16px; height: 16px; border: 2px solid #d9efe2; border-radius: 50%; position: relative; margin-right: 4px; }
.psc-hero-search-icon::after {
  content: ''; position: absolute; width: 7px; height: 2px; background: #d9efe2; right: -6px; bottom: -3px; transform: rotate(45deg); border-radius: 2px;
}
.psc-hero-search input {
  flex: 1; min-width: 0; height: 44px; border: 0; background: transparent; color: #fcfff4; font: 500 16px/1.2 var(--sans); outline: none;
}
.psc-hero-search input::placeholder { color: rgba(235, 245, 236, .72); }
.psc-hero-search input::-webkit-search-cancel-button { filter: invert(1); }
.psc-hero-search-button {
  flex: none; height: 44px; padding: 0 20px; border: 0; border-radius: 10px; background: #c5e9d1; color: #143b33;
  font: 700 14px/1 var(--sans); cursor: pointer;
}
.psc-hero-search-button:hover { background: #d9f3e2; }
.psc-hero-search-button:focus-visible { outline: 3px solid #fcfff4; outline-offset: 2px; }
.psc-hero-stats { display: flex; flex-wrap: wrap; gap: 14px 30px; margin: 22px 0 0; }
.psc-stat { display: flex; flex-direction: column; gap: 2px; min-width: 70px; }
.psc-stat strong { font: 400 34px/1 var(--serif); color: #fcfff4; }
.psc-stat span { font: 700 11px/1.3 var(--sans); letter-spacing: .08em; text-transform: uppercase; color: rgba(235, 245, 236, .8); }

/* ---- Quick chips and the note for the two filters app.js does not draw */
.psc-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 26px 0 14px; scroll-margin-top: 90px; }
.psc-chip {
  padding: 8px 15px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--teal);
  font: 700 14px/1.1 var(--sans); cursor: pointer; transition: background-color .15s, color .15s, border-color .15s;
}
.psc-chip:hover { border-color: var(--teal); }
.psc-chip:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.psc-chip[aria-pressed="true"] { background: var(--mint); border-color: var(--mint); color: #143b33; }
.psc-filter-note { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 14px; margin: 0 0 14px; color: var(--muted); font-size: 14px; }
.psc-link-button {
  padding: 4px 2px; border: 0; background: none; color: var(--teal); font: 700 14px/1.2 var(--sans); cursor: pointer; text-decoration: underline;
  text-underline-offset: 3px; text-decoration-thickness: 1px;
}
.psc-link-button:hover { text-decoration-thickness: 2px; }
html.psc-short-only #video-grid > article.video-card:not([data-psc-short]) { display: none; }

/* Ahmed, 19 Nov 2026 16:13: no Dropbox or Server tag on the cards (most videos play from Dropbox now). */
.card-storage { display: none !important; }
/* Ahmed, 16:17: no Dropbox note under a video's buttons either. */
#dropbox-playback-note, .dropbox-playback-note { display: none !important; }


/* ---- Headings inside the video window */
.psc-row-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.psc-row-heading h3 { margin: 0; font: 400 clamp(26px, 2.6vw, 34px)/1.1 var(--serif); color: var(--ink); }

/* ---- Continue watching: how far in you are */
.psc-resume { display: block; width: min(100%, 220px); height: 4px; margin-top: 7px; overflow: hidden; border-radius: 2px; background: var(--line); }
.psc-resume > span { display: block; height: 100%; width: 0; border-radius: 2px; background: var(--mint); }

/* ---- The video window */
.psc-dialog-extras { display: grid; gap: 16px; margin-top: 20px; }
.psc-dialog-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.psc-download { display: inline-flex; align-items: center; gap: 8px; }
.psc-download-icon { position: relative; width: 12px; height: 14px; border-bottom: 2px solid currentColor; }
.psc-download-icon::before { content: ''; position: absolute; left: 5px; top: 0; width: 2px; height: 9px; background: currentColor; }
.psc-download-icon::after {
  content: ''; position: absolute; left: 2px; top: 4px; width: 6px; height: 6px; border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor; transform: rotate(45deg);
}
.psc-discuss {
  display: flex; align-items: center; gap: 14px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px;
  background: var(--surface); color: var(--ink); text-decoration: none; transition: border-color .15s;
}
.psc-discuss:hover { border-color: var(--teal); }
.psc-discuss:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.psc-discuss-icon {
  flex: none; position: relative; width: 38px; height: 38px; border-radius: 12px; background: var(--mint);
}
.psc-discuss-icon::before {
  content: ''; position: absolute; left: 9px; top: 10px; width: 20px; height: 14px; border-radius: 5px; background: #143b33;
}
.psc-discuss-icon::after {
  content: ''; position: absolute; left: 12px; top: 22px; border-style: solid; border-width: 5px 5px 0 0;
  border-color: #143b33 transparent transparent transparent;
}
.psc-discuss-copy { display: grid; gap: 3px; min-width: 0; flex: 1; }
.psc-discuss-copy strong { font: 700 15px/1.3 var(--sans); }
.psc-discuss-copy span { color: var(--muted); font-size: 13px; line-height: 1.4; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.psc-discuss-arrow { color: var(--teal); font-weight: 700; }
.psc-up-next { border-top: 1px solid var(--line); padding-top: 16px; }
.psc-up-next .psc-row-heading h3 { font-size: 26px; }
.psc-autoplay { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font: 700 13px/1 var(--sans); cursor: pointer; }
.psc-autoplay input { width: 16px; height: 16px; accent-color: var(--teal); margin: 0; }
.psc-next-list { display: grid; gap: 8px; margin: 12px 0 0; padding: 0; list-style: none; }
.psc-next {
  display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; gap: 2px 12px; width: 100%; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: 12px; background: transparent; color: var(--ink); text-align: left; cursor: pointer;
}
.psc-next:hover { border-color: var(--teal); background: var(--surface); }
.psc-next:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.psc-next-time {
  grid-row: 1 / span 2; align-self: center; min-width: 52px; padding: 5px 8px; border-radius: 8px; background: var(--dark);
  color: var(--mint); font: 700 12px/1.2 var(--sans); text-align: center; font-variant-numeric: tabular-nums;
}
.psc-next-title { font: 700 14px/1.35 var(--sans); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.psc-next-meta { color: var(--muted); font-size: 12px; }
.psc-countdown {
  display: flex; align-items: center; flex-wrap: wrap; gap: 10px 12px; padding: 12px 14px; border-radius: 14px;
  background: var(--mint); color: #143b33;
}
.psc-countdown-copy { display: grid; gap: 2px; flex: 1; min-width: 180px; }
.psc-countdown-copy strong { font: 700 15px/1.2 var(--sans); }
.psc-countdown-copy span { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.psc-countdown .button { color: #143b33; border-color: rgba(20, 59, 51, .45); }
.psc-countdown .button-solid { background: #143b33; color: #fcfff4; border-color: #143b33; }
.psc-pip { white-space: nowrap; }

@media (max-width: 720px) {
  .psc-hero-search { margin-top: 20px; }
  .psc-hero-search-button { padding: 0 14px; }
  .psc-stat strong { font-size: 28px; }
  .psc-hero-stats { gap: 12px 22px; }
  .psc-chips { flex-wrap: nowrap; overflow-x: auto; margin-right: calc(-1 * var(--gutter)); padding-right: var(--gutter); scrollbar-width: none; }
  .psc-chip { flex: none; }
}
@media (prefers-reduced-motion: reduce) {
  .psc-chip, .psc-discuss { transition: none; }
}

/* ======================================================================================================================
   v2 (Claude, 19 Nov 2026; Ahmed 19:09 and 19:27): the watch page, the header, rows of large pictures and Series.
   ====================================================================================================================== */

/* ---- Header: Library, Series, Viewing history, Saved; Search */
html.psc-library-v2 .site-header .navigation { display: flex; align-items: center; gap: clamp(14px, 2vw, 28px); flex-wrap: wrap; }
.psc-nav-link { color: inherit; font: inherit; text-decoration: none; white-space: nowrap; }
.psc-header-search { white-space: nowrap; }

/* ---- Pictures used in the rows, Up next and Series */
.psc-thumb { position: relative; display: block; aspect-ratio: 16 / 9; overflow: hidden; background: linear-gradient(135deg, #24474b, #0d2023); }
.psc-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.psc-thumb-blank { position: absolute; inset: 0; display: grid; place-items: center; }
.psc-thumb-blank::before {
  content: ''; width: 34px; height: 26px; border: 3px solid rgba(197, 233, 209, .55); border-radius: 6px;
  box-shadow: inset 6px 0 0 -3px rgba(197, 233, 209, .55), inset -6px 0 0 -3px rgba(197, 233, 209, .55);
}
.psc-thumb-time {
  position: absolute; right: 8px; bottom: 8px; padding: 3px 7px; border-radius: 6px; background: rgba(0, 0, 0, .78); color: #fff;
  font: 700 12px/1.2 var(--sans); font-variant-numeric: tabular-nums;
}
.psc-thumb-resume { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: rgba(255, 255, 255, .28); }
.psc-thumb-resume > span { display: block; height: 100%; background: var(--mint); }
.psc-row-heading--section { margin: 0 0 14px; }
.psc-row-heading--section h3 { margin: 0; }
.psc-row-link {
  flex: none; padding: 4px 0; border: 0; background: none; color: var(--teal); font: 700 15px/1.2 var(--sans); cursor: pointer; white-space: nowrap;
}
.psc-row-link:hover { text-decoration: underline; text-underline-offset: 4px; }
.psc-row-link:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
.psc-row-note { color: var(--muted); font-size: 14px; }

/* ---- Continue watching: large pictures with the resume bar and how much is left */
html.psc-library-v2 #continue-watching .continue-list {
  display: grid; grid-auto-flow: column; grid-auto-columns: clamp(240px, 23vw, 340px); gap: 18px; margin: 0; padding: 2px 2px 14px;
  overflow-x: auto; list-style: none; scroll-snap-type: x proximity; scrollbar-width: thin;
}
html.psc-library-v2 #continue-watching .continue-item {
  position: relative; display: block; min-width: 0; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: 16px; overflow: hidden;
  background: var(--surface); scroll-snap-align: start;
}
html.psc-library-v2 #continue-watching .continue-open {
  display: flex; flex-direction: column; align-items: stretch; width: 100%; height: 100%; margin: 0; padding: 0; border: 0; background: none;
  color: var(--ink); text-align: left; cursor: pointer;
}
html.psc-library-v2 #continue-watching .continue-open:focus-visible { outline: 3px solid var(--focus); outline-offset: -3px; }
html.psc-library-v2 #continue-watching .continue-icon { display: none; }
html.psc-library-v2 #continue-watching .continue-details { display: grid; gap: 5px; padding: 12px 14px 14px; }
html.psc-library-v2 #continue-watching .continue-title {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font: 700 16px/1.3 var(--sans);
}
html.psc-library-v2 #continue-watching .continue-item[data-psc-row] .continue-progress { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
html.psc-library-v2 #continue-watching .continue-item[data-psc-row] .psc-resume { display: none; }
.psc-row-meta { color: var(--muted); font-size: 14px; }
html.psc-library-v2 #continue-watching .continue-remove {
  position: absolute; top: 8px; right: 8px; z-index: 2; width: 30px; height: 30px; border: 0; border-radius: 50%; background: rgba(0, 0, 0, .62);
  color: #fff; font-size: 18px; line-height: 1; cursor: pointer;
}

/* ---- Recently added: one row of large pictures, each marked New */
html.psc-library-v2 #recently-added-grid {
  display: grid; grid-auto-flow: column; grid-auto-columns: clamp(230px, 21vw, 310px); grid-template-columns: none; gap: 18px;
  overflow-x: auto; padding: 2px 2px 14px; scroll-snap-type: x proximity; scrollbar-width: thin;
}
html.psc-library-v2 #recently-added-grid > article.video-card { scroll-snap-align: start; min-width: 0; }
html.psc-library-v2 #recently-added-grid .card-art { position: relative; }
.psc-new {
  position: absolute; top: 10px; right: 10px; z-index: 2; padding: 4px 9px; border-radius: 7px; background: #f2d3a5; color: #3b2a12;
  font: 800 12px/1.1 var(--sans); letter-spacing: .06em; text-transform: uppercase;
}

/* ---- Series */
.psc-series { margin: 34px 0 30px; scroll-margin-top: 90px; }
.psc-series h3 { font: 400 clamp(28px, 2.8vw, 38px)/1.1 var(--serif); color: var(--ink); }
.psc-series-row {
  display: grid; grid-auto-flow: column; grid-auto-columns: clamp(220px, 19vw, 280px); gap: 16px; overflow-x: auto; padding: 2px 2px 14px;
  scroll-snap-type: x proximity; scrollbar-width: thin;
}
.psc-series-card {
  display: grid; gap: 4px; padding: 0 0 14px; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; background: var(--surface);
  color: var(--ink); text-align: left; cursor: pointer; scroll-snap-align: start; transition: border-color .15s, transform .15s;
}
.psc-series-card:hover { border-color: var(--teal); transform: translateY(-2px); }
.psc-series-card:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.psc-series-art {
  display: grid; grid-template-columns: 2fr 1fr; grid-template-rows: 1fr 1fr; gap: 2px; aspect-ratio: 16 / 9; margin-bottom: 8px;
  background: linear-gradient(135deg, #24474b, #0d2023);
}
.psc-series-art > :first-child { grid-row: 1 / span 2; }
.psc-series-art > :only-child { grid-column: 1 / span 2; }
.psc-series-art img { display: block; width: 100%; height: 100%; object-fit: cover; }
.psc-series-art .psc-thumb-blank { position: relative; }
.psc-series-name { padding: 0 14px; font: 700 16px/1.25 var(--sans); }
.psc-series-count { padding: 0 14px; color: var(--muted); font-size: 14px; }

/* ---- The watch page */
html.psc-watching, html.psc-watching body { overflow: hidden; }
html.psc-library-v2 dialog#video-dialog.psc-watch {
  position: fixed; inset: 0; width: 100vw; max-width: none; height: 100vh; height: 100dvh; max-height: none; margin: 0; padding: 0;
  border: 0; border-radius: 0; background: var(--paper); color: var(--ink); box-shadow: none; overflow-x: hidden; overflow-y: auto;
  overscroll-behavior: contain;
}
html.psc-library-v2 dialog#video-dialog.psc-watch::backdrop { background: var(--paper); }
html.psc-library-v2 #video-dialog.psc-watch .dialog-inner {
  display: grid; grid-template-columns: minmax(0, 1fr) clamp(300px, 27vw, 400px); grid-template-areas: "bar bar" "stage side" "body side";
  grid-template-rows: auto auto 1fr; align-items: start; gap: 22px clamp(20px, 2.4vw, 36px); width: 100%; max-width: 1640px; min-height: 100%;
  margin: 0 auto; padding: 0 var(--gutter) 64px; border: 0; border-radius: 0; background: transparent; box-shadow: none; overflow: visible;
}
html.psc-library-v2 #video-dialog.psc-watch .dialog-close { display: none; }

.psc-watch-bar {
  grid-area: bar; position: sticky; top: 0; z-index: 6; display: flex; align-items: center; gap: clamp(12px, 1.8vw, 26px);
  margin: 0 calc(-1 * var(--gutter)); padding: 12px var(--gutter); border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--paper) 90%, transparent); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
}
.psc-watch-back {
  display: inline-flex; align-items: center; gap: 6px; flex: none; padding: 8px 14px 8px 10px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--surface); color: var(--ink); font: 700 14px/1 var(--sans); cursor: pointer;
}
.psc-watch-back span:first-child { font-size: 20px; line-height: .7; }
.psc-watch-back:hover { border-color: var(--teal); }
.psc-watch-bar .brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; flex: none; }
.psc-watch-bar .brand img, .psc-watch-bar .brand-logo { width: 36px; height: 36px; border-radius: 9px; }
.psc-watch-bar .brand-name { font: 700 16px/1.1 var(--sans); }
.psc-watch-bar .brand-tag { display: none; }
.psc-watch-nav { display: flex; align-items: center; gap: clamp(10px, 1.6vw, 24px); margin-left: clamp(4px, 1vw, 18px); flex-wrap: wrap; }
.psc-watch-link {
  padding: 6px 2px; border: 0; background: none; color: var(--muted); font: 600 15px/1.2 var(--sans); text-decoration: none; cursor: pointer; white-space: nowrap;
}
.psc-watch-link:hover, .psc-watch-link:focus-visible { color: var(--ink); }
.psc-watch-search {
  margin-left: auto; flex: none; padding: 9px 18px; border: 1px solid var(--line); border-radius: 12px; background: transparent; color: var(--ink);
  font: 700 14px/1 var(--sans); cursor: pointer;
}
.psc-watch-search:hover { border-color: var(--teal); }
.psc-watch-bar button:focus-visible, .psc-watch-bar a:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

/* The stage: picture with a large Play button, then the player and its controls */
.psc-stage {
  grid-area: stage; position: relative; min-width: 0; border-radius: 18px; overflow: hidden; background: #050b0c;
  box-shadow: 0 22px 54px rgba(0, 0, 0, .32);
}
.psc-poster { position: relative; display: grid; place-items: center; aspect-ratio: 16 / 9; background: #0b1416; }
.psc-poster[hidden] { display: none; }
.psc-poster #dialog-art, .psc-poster .dialog-art {
  position: absolute; inset: 0; width: 100%; height: 100%; max-height: none; margin: 0; border-radius: 0; aspect-ratio: auto; background: #0b1416;
}
.psc-poster .dialog-art img { width: 100%; height: 100%; object-fit: cover; }
.psc-poster::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0, 0, 0, .08), rgba(0, 0, 0, .5)); pointer-events: none; }
.psc-big-play {
  position: relative; z-index: 2; display: grid; place-items: center; width: 92px; height: 92px; border: 0; border-radius: 50%;
  background: rgba(8, 20, 22, .8); box-shadow: 0 12px 32px rgba(0, 0, 0, .45); cursor: pointer; transition: transform .15s, background-color .15s;
}
.psc-big-play[hidden] { display: none; }
.psc-big-play:hover { transform: scale(1.06); background: var(--mint); }
.psc-big-play:focus-visible { outline: 4px solid var(--mint); outline-offset: 4px; }
.psc-big-play-icon { width: 0; height: 0; margin-left: 7px; border-style: solid; border-width: 17px 0 17px 28px; border-color: transparent transparent transparent #fff; }
.psc-big-play:hover .psc-big-play-icon { border-left-color: #143b33; }
.psc-poster-note {
  position: absolute; z-index: 2; left: 16px; bottom: 14px; margin: 0; padding: 7px 13px; border-radius: 999px; background: rgba(8, 20, 22, .82);
  color: #e8f5ec; font: 700 13px/1 var(--sans);
}
.psc-poster .preview-restriction { position: absolute; inset: 0; display: grid; place-items: center; color: #cfe3da; font: 700 15px/1.3 var(--sans); }
html.psc-library-v2 #video-dialog.psc-watch .psc-stage #player-shell { margin: 0; padding: 0; border: 0; border-radius: 0; background: #050b0c; }
html.psc-library-v2 #video-dialog.psc-watch .psc-stage .player-screen { position: relative; aspect-ratio: 16 / 9; margin: 0; border-radius: 0; background: #000; }
html.psc-library-v2 #video-dialog.psc-watch .psc-stage .player-screen video {
  display: block; width: 100%; height: 100%; max-height: none; object-fit: contain; border-radius: 0; background: #000;
}
.psc-started {
  position: absolute; z-index: 3; left: 16px; top: 14px; padding: 7px 13px; border-radius: 999px; background: rgba(10, 40, 38, .84); color: var(--mint);
  font: 700 13px/1 var(--sans); pointer-events: none;
}
.psc-started[hidden] { display: none; }
.psc-track { position: relative; height: 6px; margin: 12px 18px 2px; border-radius: 3px; background: rgba(255, 255, 255, .22); cursor: pointer; }
.psc-track::before { content: ''; position: absolute; left: 0; right: 0; top: -9px; bottom: -9px; }
.psc-track:focus-visible { outline: 3px solid var(--mint); outline-offset: 6px; }
.psc-track-fill { position: absolute; left: 0; top: 0; bottom: 0; width: 0; border-radius: 3px; background: var(--mint); }
.psc-track-ticks { position: absolute; inset: 0; pointer-events: none; }
.psc-tick { position: absolute; top: -4px; width: 3px; height: 14px; margin-left: -1px; border-radius: 2px; background: #f2c98e; }
html.psc-library-v2 #video-dialog.psc-watch .psc-stage #player-tools {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: 0; padding: 10px 14px 12px; border: 0; background: #050b0c; color: #e8f5ec;
}
html.psc-library-v2 #video-dialog.psc-watch .psc-stage #player-tools .player-skip,
html.psc-library-v2 #video-dialog.psc-watch .psc-stage #player-tools select {
  min-height: 34px; padding: 6px 13px; border: 0; border-radius: 999px; background: rgba(255, 255, 255, .12); color: #f2f8f3;
  font: 700 13px/1.2 var(--sans); cursor: pointer;
}
html.psc-library-v2 #video-dialog.psc-watch .psc-stage #player-tools .player-skip:hover,
html.psc-library-v2 #video-dialog.psc-watch .psc-stage #player-tools select:hover { background: rgba(255, 255, 255, .2); }
html.psc-library-v2 #video-dialog.psc-watch .psc-stage #player-tools .player-select { display: inline-flex; align-items: center; gap: 6px; color: #b9cdc6; font: 600 12px/1 var(--sans); }
html.psc-library-v2 #video-dialog.psc-watch .psc-stage #player-tools .player-select:first-of-type { margin-left: auto; }
html.psc-library-v2 #video-dialog.psc-watch .psc-stage #player-tools option { color: #102022; }
.psc-clock { display: inline-flex; align-items: center; gap: 10px; margin-right: 6px; }
.psc-time { font: 700 14px/1 var(--sans); font-variant-numeric: tabular-nums; color: #f2f8f3; white-space: nowrap; }
.psc-toggle { position: relative; width: 34px; height: 34px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .12); cursor: pointer; }
.psc-toggle::before {
  content: ''; position: absolute; left: 13px; top: 10px; border-style: solid; border-width: 7px 0 7px 11px; border-color: transparent transparent transparent #fff;
}
.psc-toggle[data-state="playing"]::before { left: 12px; top: 11px; width: 3px; height: 12px; border: 0; background: #fff; box-shadow: 6px 0 0 #fff; }
.psc-full { font-size: 16px !important; }

/* Under the stage: title, tags, buttons, app.js's own buttons and messages, the tabs */
html.psc-library-v2 #video-dialog.psc-watch .dialog-body { grid-area: body; display: flex; flex-direction: column; gap: 14px; min-width: 0; padding: 0; }
html.psc-library-v2 #video-dialog.psc-watch #video-specialty { display: none; }
html.psc-library-v2 #video-dialog.psc-watch #video-title { margin: 2px 0 0; font: 400 clamp(30px, 3.1vw, 46px)/1.08 var(--serif); color: var(--ink); }
.psc-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.psc-tag { padding: 7px 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--teal); font: 700 14px/1 var(--sans); }
.psc-watch-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.psc-watch-actions .button { display: inline-flex; align-items: center; gap: 8px; }
.psc-save { background: var(--mint) !important; border-color: var(--mint) !important; color: #143b33 !important; }
.psc-heart { position: relative; width: 14px; height: 13px; }
.psc-heart::before, .psc-heart::after {
  content: ''; position: absolute; top: 0; width: 8px; height: 12px; border: 2px solid currentColor; border-bottom: 0; border-radius: 8px 8px 0 0;
}
.psc-heart::before { left: 1px; transform: rotate(-45deg); transform-origin: 100% 100%; }
.psc-heart::after { left: 5px; transform: rotate(45deg); transform-origin: 0 100%; }
html.psc-library-v2 #video-dialog.psc-watch .dialog-actions { gap: 10px; margin: 0; }
html.psc-library-v2 #video-dialog.psc-watch .dialog-actions:not(:has(> :not([hidden]):not(#play-video):not(#share-video):not(.psc-video-study):not(.dialog-status))) { display: none; }
html.psc-library-v2 #video-dialog.psc-watch #play-video,
html.psc-library-v2 #video-dialog.psc-watch #share-video,
html.psc-library-v2 #video-dialog.psc-watch .psc-video-study,
html.psc-library-v2 #video-dialog.psc-watch #psc-dialog-extras { display: none !important; }
.psc-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.psc-tab {
  padding: 9px 16px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--teal); font: 700 14px/1 var(--sans); cursor: pointer;
}
.psc-tab[aria-selected="true"] { background: var(--mint); border-color: var(--mint); color: #143b33; }
.psc-tab:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.psc-tab-panel { min-height: 40px; }
.psc-tab-panel:focus-visible { outline: 3px solid var(--focus); outline-offset: 4px; border-radius: 8px; }
.psc-panel-copy { margin: 0 0 12px; color: var(--muted); font-size: 15px; line-height: 1.5; }
.psc-panel-buttons { display: flex; flex-wrap: wrap; gap: 10px; }
/* On a wide screen the Key moments are in the right column, so the tab only says how to add one. */
@media (min-width: 1001px) {
  html[data-psc-tab="moments"] .psc-moments--tab .psc-moment-list { display: none; }
}

/* The right column: Key moments, Discuss in the forum, Up next */
.psc-watch-side { grid-area: side; display: grid; gap: 16px; min-width: 0; position: sticky; top: 84px; }
.psc-side-box { padding: 18px 18px 16px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); }
.psc-side-box h2 { margin: 0 0 12px; font: 400 26px/1.1 var(--serif); color: var(--ink); }
.psc-watch-side .psc-row-heading h2 { margin: 0; }
.psc-moment-list { display: grid; margin: 0 0 12px; padding: 0; list-style: none; }
.psc-moment { display: flex; align-items: center; gap: 6px; border-bottom: 1px solid var(--line); }
.psc-moment:last-child { border-bottom: 0; }
.psc-moment-go {
  display: flex; align-items: baseline; gap: 14px; flex: 1; min-width: 0; padding: 10px 2px; border: 0; background: none; color: var(--ink);
  font: 500 15px/1.35 var(--sans); text-align: left; cursor: pointer;
}
.psc-moment-go:hover .psc-moment-label { text-decoration: underline; text-underline-offset: 3px; }
.psc-moment-time { flex: none; min-width: 44px; color: var(--teal); font-weight: 800; font-variant-numeric: tabular-nums; }
.psc-moment-label { min-width: 0; overflow-wrap: anywhere; }
.psc-moment-remove { flex: none; width: 28px; height: 28px; border: 0; border-radius: 50%; background: none; color: var(--muted); font-size: 18px; cursor: pointer; }
.psc-moment-remove:hover { background: var(--paper); color: var(--ink); }
.psc-moment-add { display: flex; gap: 8px; }
.psc-moment-input {
  flex: 1; min-width: 0; height: 40px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); color: var(--ink);
  font: 500 14px/1 var(--sans);
}
.psc-moment-input:focus { outline: 2px solid var(--focus); outline-offset: 1px; }
.psc-moment-mark { flex: none; white-space: nowrap; font-variant-numeric: tabular-nums; }
.psc-watch-side .psc-discuss { padding: 16px 18px; }
.psc-watch-side .psc-up-next { border-top: 1px solid var(--line); padding-top: 18px; }
.psc-watch-side .psc-next-list { gap: 12px; margin-top: 14px; }
.psc-watch-side .psc-next {
  display: flex; align-items: center; gap: 12px; padding: 0; border: 0; border-radius: 12px; background: none; overflow: visible;
}
.psc-watch-side .psc-next:hover { background: none; }
.psc-watch-side .psc-next:hover .psc-next-title { text-decoration: underline; text-underline-offset: 3px; }
.psc-next-thumb { flex: none; width: 46%; max-width: 176px; border-radius: 12px; }
.psc-next-copy { display: grid; gap: 4px; min-width: 0; }
.psc-watch-side .psc-next-title { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; white-space: normal; font: 700 15px/1.3 var(--sans); }
.psc-watch-side .psc-next-meta { color: var(--teal); font-size: 13px; font-weight: 600; }
.psc-watch-side .psc-countdown { margin-bottom: 12px; }

@media (max-width: 1000px) {
  html.psc-library-v2 #video-dialog.psc-watch .dialog-inner { grid-template-columns: minmax(0, 1fr); grid-template-areas: "bar" "stage" "body" "side"; gap: 18px; }
  .psc-watch-side { position: static; }
  .psc-watch-nav { display: none; }
}
@media (max-width: 640px) {
  html.psc-library-v2 #video-dialog.psc-watch .dialog-inner { padding: 0 0 48px; }
  .psc-watch-bar { margin: 0; padding: 10px 14px; gap: 10px; }
  .psc-watch-bar .brand-text { display: none; }
  .psc-stage { border-radius: 0; box-shadow: none; }
  html.psc-library-v2 #video-dialog.psc-watch .dialog-body, .psc-watch-side { padding: 0 16px; }
  .psc-big-play { width: 72px; height: 72px; }
  .psc-big-play-icon { border-width: 14px 0 14px 22px; }
  html.psc-library-v2 #video-dialog.psc-watch .psc-stage #player-tools { padding: 8px 10px 10px; gap: 6px; }
  html.psc-library-v2 #video-dialog.psc-watch .psc-stage #player-tools .player-select:first-of-type { margin-left: 0; }
  .psc-time { font-size: 13px; }
}
@media (prefers-reduced-motion: reduce) {
  .psc-big-play, .psc-series-card { transition: none; }
}

/* v2 polish (Claude, 19 Nov 2026 20:25) */
.psc-watch-bar .brand-logo, .psc-watch-bar .brand img { padding: 3px; background: #f8f8f1; object-fit: contain; }
.psc-heart { width: auto; height: auto; font-size: 17px; line-height: 1; }
.psc-heart::before, .psc-heart::after { content: none; }
html.psc-library-v2 #video-dialog.psc-watch video { scroll-margin-top: 90px; cursor: pointer; }
/* Summary and facts are in About; the tags under the title carry the main facts. */
html:not([data-psc-tab="about"]) #video-dialog.psc-watch .dialog-body > #video-summary,
html:not([data-psc-tab="about"]) #video-dialog.psc-watch .dialog-body > #video-facts { display: none; }
.psc-tab-panel #video-facts { margin: 12px 0 0; }
.psc-tab-panel #video-summary { margin: 0; font-size: 16px; line-height: 1.55; color: var(--ink); }
html.psc-library-v2 .site-header .psc-nav-link { opacity: 1; color: inherit; }
/* On a phone the Key moments tab holds the list and Mark; the box in the column below would repeat it. */
@media (max-width: 1000px) { .psc-side-moments { display: none; } }

/* v4 (Claude, 19 Nov 2026; Ahmed 20:35 "previous video card appearance appear then new appearance"): the new look from the first
   moment. index.html carries the classes, header links and hero; what still waits for data is kept out of sight until it is ready,
   with a fallback that shows it anyway after two seconds. */
@keyframes psc-reveal { to { visibility: visible; } }
/* A Continue watching item shows once its picture and minutes left are on it (or once it is known to have none). */
html.psc-library-v2 #continue-watching .continue-item:not([data-psc-row]) { visibility: hidden; animation: psc-reveal 0s linear 2s forwards; }
/* Recently added: the New badge is drawn by the stylesheet, so it is there with the card. */
html.psc-library-v2 #recently-added-grid .card-art::after {
  content: 'New'; position: absolute; top: 10px; right: 10px; z-index: 2; padding: 4px 9px; border-radius: 7px; background: #f2d3a5;
  color: #3b2a12; font: 800 12px/1.1 var(--sans); letter-spacing: .06em; text-transform: uppercase; pointer-events: none;
}
[data-psc-history][hidden], .psc-nav-link[hidden] { display: none !important; }
/* A shared video address: the page waits behind its own colour until the watch page opens (four seconds at most). */
html.psc-opening body > :not(dialog) { visibility: hidden; animation: psc-reveal 0s linear 4s forwards; }

/* v6 (Claude, 19 Nov 2026; Ahmed 21:10, four marked screenshots): no Recently added, no Series, no quick chips and no hero search;
   "All videos" heads the video grid. */
html.psc-library-v2 #recently-added { display: none !important; }
.psc-all-title { margin: 30px 0 18px; font: 400 clamp(28px, 2.8vw, 38px)/1.1 var(--serif); color: var(--ink); }
/* The library's playback note stays at the right now that its heading is out of sight (v7). */
html.psc-library-v2 .library-heading { justify-content: flex-end; }

/* v10 (Claude, 19 Nov 2026; Ahmed 21:26 and 21:27): "Browse the library" under the title again (it goes to the search bar), and
   no Continue watching on the library page (Viewing history in the header has a member's videos). */
html.psc-library-v2 .hero .button-hero { display: inline-flex; margin-top: 4px; }
html.psc-library-v2 #continue-watching { display: none !important; }
html.psc-library-v2 #video-dialog.psc-watch video[src] { cursor: pointer; }

/* v11 (19 Nov 2026): the reviewed key moments (Ahmed approved), above the member's own, and their marks on the time bar. */
.psc-moment-list--reviewed { margin-bottom: 6px; }
.psc-reviewed-by { margin: 0 0 12px; color: var(--muted, #9fb3ad); font-size: .78rem; line-height: 1.4; }
.psc-moments-own { margin: 4px 0 8px; font-size: .92rem; font-weight: 700; }
.psc-tick--reviewed { background: #7fd3c0; width: 3px; }

/* Keep the collection grid and watch queue consistent with the player's 16:9 frame. */
html.psc-library-v2 #video-grid {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 270px), 1fr));
  gap: clamp(14px, 2vw, 24px);
}
html.psc-library-v2 #video-grid .card-art { aspect-ratio: 16 / 9; }
.psc-next-copy { flex: 1; }
.psc-watch-side .psc-next:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.psc-watch-side .psc-moment-list--reviewed { max-height: 17rem; overflow: auto; }

html.psc-library-v2 #video-dialog.psc-watch #player-shell:fullscreen {
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: 100%;
  height: 100%;
}
html.psc-library-v2 #video-dialog.psc-watch #player-shell:fullscreen .player-screen {
  flex: 1;
  min-height: 0;
  aspect-ratio: auto;
}

html.psc-library-v2 .hero-inner { min-height: 0; padding-block: clamp(30px, 3.5vw, 52px); }
html.psc-library-v2 .hero-summary { margin-block: 12px 16px; }
html.psc-library-v2 .library { padding-top: clamp(18px, 2.5vw, 36px); }
html.psc-library-v2 .library-heading { margin-bottom: 12px; }
html.psc-library-v2 #library-toolbar.psc-compact-filters {
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "search filters" "results results";
  align-items: start;
}
.psc-filter-panel { grid-area: filters; color: var(--ink); }
.psc-filter-panel summary { min-height: 44px; align-content: center; padding-inline: 14px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; font-weight: 700; }
.psc-filter-panel summary:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
html.psc-library-v2 #library-toolbar:has(.psc-filter-panel[open]) {
  grid-template-columns: minmax(0, 1fr); grid-template-areas: "search" "filters" "results";
}
.psc-filter-options { display: grid; gap: 12px; margin-top: 12px; }
.psc-filter-options > .sort-field, .psc-filter-options > .video-facets, .psc-filter-options > .tag-filter-section { grid-area: auto; }
@supports (content-visibility: auto) {
  html.psc-library-v2 #video-grid > .video-card {
    content-visibility: auto;
    contain-intrinsic-block-size: auto 320px;
  }
}
@media (max-width: 640px) {
  html.psc-library-v2 #library-toolbar.psc-compact-filters {
    grid-template-columns: minmax(0, 1fr); grid-template-areas: "search" "filters" "results";
  }
  html.psc-library-v2 .hero-inner { padding-block: 26px; }
  html.psc-library-v2 .psc-hero-stats { margin-top: 14px; }
  html.psc-library-v2 .psc-all-title { margin: 16px 0 12px; }
}

/* Claude, 23 Nov 2026 (Ahmed: the Viewing history close button does not work on phones, website and app).
   With a long list the Viewing history panel fills a phone screen: its close button sat in the top strip of the screen, where
   phones keep taps for their own bars, and it scrolled away with the list. It now stays in view while the list scrolls, keeps
   clear of the notch and the screen edge, and is a full 44 px tap target on touch screens. claude-history-close-v1 */
.history-dialog .dialog-close {
  position: sticky;
  top: max(12px, env(safe-area-inset-top, 0px));
  margin: 12px 12px -52px auto;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
@media (pointer: coarse) {
  .history-dialog { max-height: calc(100% - 72px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px)); }
  .history-dialog .dialog-close { width: 44px; height: 44px; margin-bottom: -56px; }
}
