/* ScaTube page layouts and composite components, built on the tokens and
   parts in scatube-ds.css (load that first). No emoji, no glass, no gradients
   on surfaces: flat layers, one accent, 16:9 thumbnails everywhere. */

/* ── Upload dialog (partials/upload_dialog.php + scatube-upload.js) ── */
/* Self-contained so it also renders on pages that are not .st-body yet. */
html.st-upload-open { overflow: hidden; }
.st-upload { z-index: 10050; color: var(--st-text); font: 400 var(--st-text-md)/1.5 var(--st-font); -webkit-font-smoothing: antialiased; text-align: left; }
.st-upload *, .st-upload *::before, .st-upload *::after { box-sizing: border-box; }
.st-upload button, .st-upload input, .st-upload textarea { font: inherit; color: inherit; letter-spacing: normal; text-transform: none; }
.st-upload a { color: inherit; text-decoration: none; }
.st-upload :focus-visible { outline: none; box-shadow: var(--st-focus); }
.st-upload h2, .st-upload p, .st-upload ol { margin: 0; }

.st-upload__dialog { display: flex; flex-direction: column; width: min(600px, 100%); overflow: hidden; }
.st-upload__dialog > .st-dialog__head, .st-upload__dialog > .st-dialog__foot { flex: none; }
.st-upload__dialog > .st-dialog__body { flex: 1 1 auto; min-height: 0; overflow: auto; overscroll-behavior: contain; }

.st-upload__drop { margin-bottom: var(--st-space-4); }
.st-upload__pick {
  display: grid; justify-items: center; gap: 4px; width: 100%; padding: 28px 16px;
  border: 1px dashed var(--st-line-strong); border-radius: var(--st-radius);
  background: var(--st-surface-2); color: var(--st-text-3); font-size: var(--st-text-xs); text-align: center; cursor: pointer;
  transition: border-color var(--st-fast) var(--st-ease), background var(--st-fast) var(--st-ease);
}
.st-upload__pick strong { color: var(--st-text); font-size: var(--st-text-lg); font-weight: 600; }
.st-upload__pick-ico { display: grid; place-items: center; width: 48px; height: 48px; margin-bottom: 6px; border-radius: 50%; background: var(--st-surface-3); color: var(--st-text); transition: background var(--st-fast) var(--st-ease), color var(--st-fast) var(--st-ease); }
.st-upload__pick:hover, .st-upload__drop.is-over .st-upload__pick { border-color: var(--st-accent-text); background: var(--st-accent-tint); }
.st-upload__pick:hover .st-upload__pick-ico, .st-upload__drop.is-over .st-upload__pick-ico { background: var(--st-accent); color: #fff; }

.st-upload__file { display: flex; align-items: center; gap: var(--st-space-3); padding: var(--st-space-3); border: 1px solid var(--st-line); border-radius: var(--st-radius); background: var(--st-surface-2); }
.st-upload__drop.is-over .st-upload__file { border-color: var(--st-accent-text); }
.st-upload__file[hidden], .st-upload__pick[hidden] { display: none; }
.st-upload__thumb { position: relative; display: grid; place-items: center; flex: none; width: 128px; aspect-ratio: 16 / 9; overflow: hidden; border-radius: 6px; background: #000; color: var(--st-text-3); }
.st-upload__thumb img { width: 100%; height: 100%; object-fit: contain; }
.st-upload__thumb .st-duration { right: 4px; bottom: 4px; font-size: 11px; }
.st-upload__file-info { display: grid; flex: 1; gap: 2px; min-width: 0; }
.st-upload__file-info strong { overflow: hidden; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.st-upload__file-info span { color: var(--st-text-3); font-size: var(--st-text-xs); }
.st-upload__file--static { margin-bottom: var(--st-space-5); }

.st-upload__resume { margin-bottom: var(--st-space-4); }
.st-upload__resume[hidden] { display: none; }
.st-upload__label-row { display: flex; align-items: baseline; justify-content: space-between; gap: var(--st-space-2); }
.st-upload__label-row .st-hint { font-variant-numeric: tabular-nums; }
.st-upload__cats { min-width: 0; margin: 0 0 var(--st-space-4); padding: 0; border: 0; }
.st-upload__cats legend { margin-bottom: 6px; padding: 0; }
.st-upload__chips { display: flex; flex-wrap: wrap; gap: var(--st-space-2); }
.st-upload__chip { position: relative; }
.st-upload__chip input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: pointer; }
.st-upload__chip:has(input:focus-visible) { box-shadow: var(--st-focus); }
.st-upload__trap { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.st-upload__as { display: flex; align-items: center; gap: var(--st-space-2); margin-bottom: var(--st-space-3); color: var(--st-text-2); font-size: var(--st-text-sm); }
.st-upload__as strong { color: var(--st-text); }
.st-upload__policy { display: flex; gap: var(--st-space-2); color: var(--st-text-3); font-size: var(--st-text-xs); line-height: 1.5; }
.st-upload__policy .st-ico { margin-top: 1px; color: var(--st-text-2); }
.st-upload__error { margin-top: var(--st-space-3) !important; }
.st-upload__error[hidden] { display: none; }
.st-upload .st-upload__link { display: inline; width: auto; height: auto; min-height: 0; margin: 0; padding: 0; border: 0; border-radius: 0; background: none; box-shadow: none; color: var(--st-accent-text); font-weight: 600; line-height: inherit; vertical-align: baseline; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }

.st-upload__bar { height: 8px; }
.st-upload__numbers { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px var(--st-space-3); margin-top: 10px; font-variant-numeric: tabular-nums; }
.st-upload__numbers strong { font: 700 var(--st-text-2xl)/1 var(--st-font); }
.st-upload__numbers span { color: var(--st-text-2); font-size: var(--st-text-sm); }
.st-upload__note { margin-top: var(--st-space-4); }
.st-upload__note[hidden], .st-upload [data-after-note][hidden] { display: none; }
.st-upload__keep { margin-top: var(--st-space-4) !important; }

.st-upload__stages { display: grid; margin-bottom: var(--st-space-4) !important; padding: 0; list-style: none; }
.st-upload__stages li { position: relative; display: flex; gap: var(--st-space-3); padding-bottom: 18px; color: var(--st-text-3); }
.st-upload__stages li:last-child { padding-bottom: 0; }
.st-upload__stages li::before { content: ""; position: absolute; top: 28px; bottom: 4px; left: 11px; width: 2px; border-radius: 1px; background: var(--st-line-strong); }
.st-upload__stages li:last-child::before { display: none; }
.st-upload__stages li.is-done::before { background: var(--st-success); }
.st-upload__stages li > div { display: grid; gap: 1px; padding-top: 1px; }
.st-upload__stages li strong { font-weight: 600; }
.st-upload__stages li > div span { font-size: var(--st-text-xs); }
.st-upload__stages li.is-done, .st-upload__stages li.is-active, .st-upload__stages li.is-warn, .st-upload__stages li.is-error { color: var(--st-text-2); }
.st-upload__stages li.is-done strong, .st-upload__stages li.is-active strong, .st-upload__stages li.is-warn strong, .st-upload__stages li.is-error strong { color: var(--st-text); }
.st-upload__dot { display: grid; place-items: center; flex: none; width: 24px; height: 24px; border: 2px solid var(--st-line-strong); border-radius: 50%; background: var(--st-surface-1); }
.st-upload__dot .st-ico { width: 14px; height: 14px; stroke-width: 2.4; }
.st-upload__dot .st-spinner { width: 14px; height: 14px; border-top-color: var(--st-accent-text); }
.is-active > .st-upload__dot { border-color: var(--st-accent-text); }
.is-done > .st-upload__dot { border-color: var(--st-success); background: var(--st-success); color: #07140e; }
.is-warn > .st-upload__dot { border-color: var(--st-warning); background: var(--st-warning); color: #1d1300; }
.is-error > .st-upload__dot { border-color: var(--st-danger); background: var(--st-danger); color: #1a0306; }

.st-upload__foot { flex-wrap: wrap; align-items: center; }
.st-upload__foot [hidden] { display: none; }
.st-upload__foot-left { margin-right: auto; color: var(--st-text-3); font-size: var(--st-text-xs); }
.st-toast--info .st-ico { color: var(--st-info); }
.st-toast-region { z-index: 10060; }

@media (max-width: 560px) {
  .st-upload.st-modal { place-items: end stretch; padding: 0; }
  .st-upload__dialog { width: 100%; max-height: 94dvh; border-bottom: 0; border-radius: var(--st-radius-lg) var(--st-radius-lg) 0 0; }
  .st-upload__dialog > .st-dialog__body { padding: var(--st-space-4); }
  .st-upload__thumb { width: 96px; }
  .st-upload__foot { padding: var(--st-space-3) var(--st-space-4) calc(var(--st-space-3) + env(safe-area-inset-bottom)); }
  .st-upload__foot .st-btn { flex: 1 1 auto; }
  .st-upload__foot-left:empty { display: none; }
  .st-upload__foot-left { flex-basis: 100%; }
}

/* ══ App shell (partials/shell.php + scatube-shell.js) ═════════════════════ */
.st-body [hidden] { display: none !important; }
.st-shell { min-height: 100vh; }
.st-skip { position: absolute; left: 8px; top: -60px; z-index: 1000; padding: 8px 12px; border-radius: var(--st-radius); background: var(--st-surface-3); color: var(--st-text); font-weight: 600; }
.st-skip:focus { top: 8px; }

/* Promo strip above the top bar */
.st-promo { display: flex; align-items: center; gap: var(--st-space-2); min-height: 36px; padding: 0 6px 0 var(--st-space-4); border-bottom: 1px solid rgba(255, 36, 184, .55); background: #2c0520; font-size: var(--st-text-sm); }
.st-promo__link { flex: 1; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px var(--st-space-3); padding: 6px 0; color: var(--st-gold); font-weight: 600; }
.st-promo__link > .st-ico { color: var(--st-accent-text); }
.st-promo__link strong { color: var(--st-text); font-weight: 700; }
.st-promo__link s { color: var(--st-text-3); font-weight: 400; }
.st-promo__cta { display: inline-flex; align-items: center; gap: 2px; padding: 3px 6px 3px 9px; border-radius: var(--st-radius-sm); background: #ff9500; color: #1b0d00; font-size: var(--st-text-xs); font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.st-promo__link:hover .st-promo__cta { background: #ffab33; }

/* Top bar */
.st-header {
  position: sticky; top: 0; z-index: 90;
  display: flex; align-items: center; gap: var(--st-space-4);
  height: var(--st-header-h); padding: 0 var(--st-space-4) 0 var(--st-space-3);
  border-bottom: 1px solid var(--st-line); background: var(--st-bg);
}
.st-header__start { display: flex; flex: none; align-items: center; gap: var(--st-space-2); }
.st-header__end { display: flex; flex: none; align-items: center; justify-content: flex-end; gap: var(--st-space-2); margin-left: auto; }
.st-header__search-open { display: none; }
.st-logo { display: inline-flex; align-items: center; padding: 4px; color: var(--st-text); }
.st-logo__word { font: 400 31px/1 var(--st-font-display); letter-spacing: 2px; }
.st-logo__word b { font-weight: 400; color: var(--st-accent); }
.st-logo__site { display: inline-flex; align-items: center; gap: 3px; padding: 4px; color: var(--st-text-2); font-size: var(--st-text-xs); font-weight: 500; white-space: nowrap; }
.st-logo__site .st-ico { width: 12px; height: 12px; }
.st-logo__site:hover { color: var(--st-accent-text); }

.st-search { display: flex; flex: 1; align-items: center; gap: var(--st-space-2); max-width: 640px; margin: 0 auto; }
.st-search__back { display: none; }
.st-search__field {
  position: relative; display: flex; flex: 1; align-items: center; height: 40px; min-width: 0;
  border: 1px solid var(--st-line-strong); border-radius: var(--st-radius); background: var(--st-surface-1);
  transition: border-color var(--st-fast) var(--st-ease), background var(--st-fast) var(--st-ease);
}
.st-search__field:hover { border-color: rgba(255, 255, 255, .22); }
.st-search__field:focus-within { border-color: var(--st-accent-text); background: var(--st-bg); }
.st-search__ico { position: absolute; left: 12px; color: var(--st-text-3); pointer-events: none; }
.st-search__field input { flex: 1; width: 100%; min-width: 0; height: 100%; padding: 0 40px 0 42px; border: 0; background: none; outline: none; font-size: var(--st-text-md); }
.st-search__field input::placeholder { color: var(--st-text-3); }
.st-body .st-search__field input:focus-visible { box-shadow: none; }
.st-search__field input::-webkit-search-cancel-button { display: none; }
.st-search__clear { position: absolute; right: 6px; display: none; place-items: center; align-items: center; justify-content: center; width: 28px; height: 28px; border: 0; border-radius: var(--st-radius-pill); background: none; color: var(--st-text-2); cursor: pointer; }
.st-search__clear:hover { background: var(--st-surface-3); color: var(--st-text); }
.st-search__go { display: grid; flex: none; place-items: center; width: 48px; height: 40px; border: 0; border-radius: var(--st-radius); background: var(--st-accent); color: #fff; cursor: pointer; transition: background var(--st-fast) var(--st-ease); }
.st-search__go:hover { background: var(--st-accent-hover); }
.ssi-meta { min-width: 0; }
.ssi-title { overflow-wrap: anywhere; display: -webkit-box; overflow: hidden; -webkit-line-clamp: 2; -webkit-box-orient: vertical; color: var(--st-text); font-weight: 600; line-height: 1.35; }
.ssi-author { margin-top: 2px; color: var(--st-text-3); font-size: var(--st-text-sm); }

.st-live { display: inline-flex; align-items: center; gap: 7px; height: 28px; padding: 0 10px; border: 1px solid var(--st-line); border-radius: var(--st-radius-pill); color: var(--st-text-2); font: 600 var(--st-text-xs)/1 var(--st-font); font-variant-numeric: tabular-nums; white-space: nowrap; }
.st-live__dot { width: 7px; height: 7px; border-radius: 50%; background: var(--st-success); box-shadow: 0 0 0 3px var(--st-success-tint); }

/* Popovers in the top bar */
.st-pop { position: relative; }
.st-pop > .st-icon-btn { position: relative; }
.st-pop__badge { position: absolute; top: 3px; right: 1px; min-width: 18px; height: 16px; padding: 0 4px; font-size: 10px; box-shadow: 0 0 0 2px var(--st-bg); }
.st-pop > .st-menu { top: calc(100% + 8px); right: 0; }
.st-notify { width: min(380px, calc(100vw - 24px)); padding: 0; overflow: hidden; }
.st-notify__head { padding: 12px 16px; border-bottom: 1px solid var(--st-line); font-weight: 600; }
.st-notify__list { max-height: min(60vh, 480px); overflow-y: auto; overscroll-behavior: contain; }
.st-notify__item { display: flex; gap: var(--st-space-3); padding: 12px 16px; color: var(--st-text-2); font-size: var(--st-text-sm); line-height: 1.4; }
.st-notify__item:hover { background: var(--st-surface-3); }
.st-notify__item strong { color: var(--st-text); font-weight: 600; }
.st-notify__item small { display: block; overflow: hidden; margin-top: 2px; color: var(--st-text-3); font-size: var(--st-text-xs); text-overflow: ellipsis; white-space: nowrap; }
.st-notify__item > span { min-width: 0; }
.st-notify__item.unread { background: var(--st-accent-tint); }
.st-notify__item.unread:hover { background: rgba(255, 36, 184, .18); }
.st-notify__empty { display: grid; justify-items: center; gap: 6px; padding: 28px 20px; color: var(--st-text-3); font-size: var(--st-text-sm); text-align: center; }
.st-notify__empty strong { color: var(--st-text-2); font-size: var(--st-text-md); }
.st-account { display: grid; place-items: center; width: 40px; height: 40px; padding: 0; border: 0; border-radius: var(--st-radius-pill); background: none; cursor: pointer; }
.st-account .st-avatar { width: 32px; height: 32px; }
.st-account:hover .st-avatar { box-shadow: 0 0 0 2px var(--st-line-strong); }
.st-account__menu { min-width: 248px; }
.st-account__who { display: flex; align-items: center; gap: var(--st-space-3); padding: 8px 10px; }
.st-account__who > div { min-width: 0; }
.st-account__who strong { display: block; overflow: hidden; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.st-account__who span { display: block; overflow: hidden; color: var(--st-text-3); font-size: var(--st-text-xs); text-overflow: ellipsis; white-space: nowrap; }
.st-menu .st-menu-item:hover { background: var(--st-surface-3); }
.st-menu .st-menu-item .st-ico { color: var(--st-text-2); }

/* Page frame: side navigation + main column */
.st-layout { display: grid; grid-template-columns: var(--st-sidebar-w) minmax(0, 1fr); align-items: start; }
.st-main { min-width: 0; min-height: calc(100vh - var(--st-header-h)); padding: 0 var(--st-space-6) var(--st-space-10); }
.st-main:focus { outline: none; }

.st-side {
  position: sticky; top: var(--st-header-h); height: calc(100vh - var(--st-header-h)); padding: var(--st-space-2) 10px var(--st-space-6);
  overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: var(--st-surface-3) transparent;
}
.st-side__group { padding: var(--st-space-2) 0; border-bottom: 1px solid var(--st-line); }
.st-side__group:last-of-type { border-bottom: 0; }
.st-side__title { padding: 10px 12px 6px; color: var(--st-text-3); font: 700 11px/1 var(--st-font); letter-spacing: .08em; text-transform: uppercase; }
.st-side__link {
  display: flex; align-items: center; gap: 14px; width: 100%; min-height: 40px; padding: 0 12px;
  border: 0; border-radius: var(--st-radius); background: none; color: var(--st-text-2);
  font: 500 var(--st-text-md)/1.2 var(--st-font); text-align: left; cursor: pointer;
  transition: background var(--st-fast) var(--st-ease), color var(--st-fast) var(--st-ease);
}
.st-side__link > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-side__link:hover { background: var(--st-surface-2); color: var(--st-text); }
.st-side__link.active { background: var(--st-accent-tint); color: var(--st-accent-text); font-weight: 600; }
.st-side__link.active .st-ico { color: var(--st-accent-text); }
.st-side__channel img { width: 24px; height: 24px; flex: none; border-radius: 50%; object-fit: cover; background: var(--st-surface-3); }
.st-side__channel > span { flex: 0 1 auto; min-width: 0; }
.st-side__channel .st-verified { margin-left: -8px; }
.st-side__note { display: block; padding: 4px 12px 10px; color: var(--st-text-3); font-size: var(--st-text-sm); line-height: 1.45; }
.st-side__signin { margin: 0 12px 8px; }
.st-side__foot { padding: var(--st-space-4) 12px; color: var(--st-text-3); font-size: var(--st-text-xs); }
.st-side__foot a { margin-right: 12px; }
.st-side__foot a:hover { color: var(--st-text-2); }
.st-side__foot p { margin: 8px 0 0; }
.st-side__lang.st-select { width: 100%; height: 34px; margin-bottom: var(--st-space-3); font-size: var(--st-text-sm); }
.st-side__backdrop { position: fixed; inset: 0; z-index: 110; border: 0; background: rgba(5, 4, 6, .62); cursor: default; }

/* Wide screens: the side navigation can shrink to an icon rail */
@media (min-width: 1101px) {
  body.sc-sidebar-collapsed:not(.st-shell--drawer) .st-layout { grid-template-columns: 76px minmax(0, 1fr); }
  body.sc-sidebar-collapsed:not(.st-shell--drawer) .st-side { padding: 4px; scrollbar-width: none; }
  body.sc-sidebar-collapsed:not(.st-shell--drawer) .st-side__group { padding: 0; border: 0; }
  body.sc-sidebar-collapsed:not(.st-shell--drawer) .st-side__group:nth-of-type(n+3),
  body.sc-sidebar-collapsed:not(.st-shell--drawer) .st-side__title,
  body.sc-sidebar-collapsed:not(.st-shell--drawer) .st-side__foot { display: none; }
  body.sc-sidebar-collapsed:not(.st-shell--drawer) .st-side__link { flex-direction: column; justify-content: center; gap: 5px; min-height: 66px; padding: 0 2px; font-size: 10px; font-weight: 500; text-align: center; }
  body.sc-sidebar-collapsed:not(.st-shell--drawer) .st-side__link > span { max-width: 100%; }
}

/* Drawer: pages that need the full width, and every narrow screen */
.st-shell--drawer .st-layout { grid-template-columns: minmax(0, 1fr); }
.st-shell--drawer .st-side {
  position: fixed; inset: 0 auto 0 0; z-index: 120; width: 264px; height: auto; padding-top: var(--st-space-3);
  background: var(--st-surface-1); box-shadow: var(--st-shadow-pop);
  transform: translateX(-102%); visibility: hidden;
  transition: transform var(--st-base) var(--st-ease), visibility 0s linear var(--st-base);
}
.st-shell--drawer .st-side.open { transform: none; visibility: visible; transition: transform var(--st-base) var(--st-ease); }
@media (max-width: 1100px) {
  .st-layout { grid-template-columns: minmax(0, 1fr); }
  .st-side {
    position: fixed; inset: 0 auto 0 0; z-index: 120; width: 264px; height: auto; padding-top: var(--st-space-3);
    background: var(--st-surface-1); box-shadow: var(--st-shadow-pop);
    transform: translateX(-102%); visibility: hidden;
    transition: transform var(--st-base) var(--st-ease), visibility 0s linear var(--st-base);
  }
  .st-side.open { transform: none; visibility: visible; transition: transform var(--st-base) var(--st-ease); }
}
body.st-drawer-open { overflow: hidden; }

/* Mobile tab bar */
.st-tabbar { display: none; }
@media (max-width: 768px) {
  .st-tabbar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 80;
    display: grid; grid-template-columns: repeat(5, 1fr);
    height: calc(56px + env(safe-area-inset-bottom, 0px)); padding-bottom: env(safe-area-inset-bottom, 0px);
    border-top: 1px solid var(--st-line); background: var(--st-bg);
  }
  .st-tabbar__item { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--st-text-3); font: 600 10px/1 var(--st-font); }
  .st-tabbar__item.is-active { background: var(--st-accent-tint); color: var(--st-accent-text); }
  .st-tabbar__item.is-active .st-ico { color: var(--st-accent-text); }
  .st-tabbar__badge { position: absolute; top: 5px; left: calc(50% + 4px); min-width: 16px; height: 16px; font-size: 10px; }
  .st-shell { padding-bottom: calc(56px + env(safe-area-inset-bottom, 0px)); }
}

/* House-rules gate (native dialog) */
.st-gate { width: min(520px, calc(100% - 32px)); max-height: calc(100dvh - 32px); padding: var(--st-space-6); overflow-y: auto; border: 1px solid var(--st-line-strong); border-radius: var(--st-radius-lg); background: var(--st-surface-1); color: var(--st-text); box-shadow: 0 24px 60px rgba(0, 0, 0, .6); }
.st-gate::backdrop { background: rgba(5, 4, 6, .88); }
.st-gate__head { display: flex; align-items: center; gap: var(--st-space-4); }
.st-gate__head img { width: 56px; height: 56px; flex: none; border-radius: 50%; object-fit: cover; background: var(--st-surface-3); }
.st-gate__head h2 { margin: 0; font: 400 30px/1 var(--st-font-display); letter-spacing: .02em; }
.st-gate__head h2:focus { outline: none; box-shadow: none; }
.st-gate__head p { margin: 4px 0 0; color: var(--st-text-2); font-size: var(--st-text-sm); }
.st-gate__rules { margin: var(--st-space-5) 0; padding: 0; list-style: none; }
.st-gate__rules li { display: flex; gap: var(--st-space-3); padding: 10px 0; border-bottom: 1px solid var(--st-line); color: var(--st-text-2); font-size: var(--st-text-sm); line-height: 1.45; }
.st-gate__rules li:first-child { padding-top: 0; }
.st-gate__rules li .st-ico { margin-top: 1px; color: var(--st-text-3); }
.st-gate__rules li:nth-child(1) .st-ico { color: var(--st-accent-text); }
.st-gate__rules li:nth-child(2) .st-ico, .st-gate__rules li:nth-child(3) .st-ico { color: var(--st-danger); }
.st-gate__rules li:nth-child(4) .st-ico { color: var(--st-success); }
.st-gate__rules li:nth-child(5) .st-ico { color: var(--st-info); }
.st-gate__rules strong { color: var(--st-text); font-weight: 600; }
.st-gate__option { display: flex; align-items: flex-start; gap: var(--st-space-3); margin-bottom: var(--st-space-2); padding: 12px; border: 1px solid var(--st-line); border-radius: var(--st-radius); background: var(--st-surface-2); color: var(--st-text-2); font-size: var(--st-text-sm); cursor: pointer; }
.st-gate__option:hover { border-color: var(--st-line-strong); }
.st-gate__option input { width: 18px; height: 18px; flex: none; margin: 1px 0 0; accent-color: var(--st-accent); }
.st-gate__option strong { display: block; color: var(--st-text); font-weight: 600; }
.st-gate__option small { display: block; margin-top: 2px; color: var(--st-text-3); font-size: var(--st-text-xs); }
.st-gate__option.sc-rules-confirm { color: var(--st-text); font-weight: 500; }
.st-gate__actions { display: flex; justify-content: flex-end; gap: var(--st-space-2); margin-top: var(--st-space-4); }
.st-gate__actions .st-btn:disabled { opacity: .45; cursor: not-allowed; }

/* Account dialog (#authModal): closed state and pieces auth-ui.css leaves to the page */
#authModal.modal-overlay { display: none; position: fixed; inset: 0; z-index: 9999; align-items: center; justify-content: center; background: rgba(5, 4, 6, .86); }
#authModal .form-error, #authModal .form-success { display: none; }
#authModal .avatar-opt { width: 48px; height: 48px; border: 2px solid var(--st-line-strong); border-radius: 50%; object-fit: cover; cursor: pointer; transition: border-color var(--st-fast) var(--st-ease); }
#authModal .avatar-opt:hover, #authModal .avatar-opt.selected { border-color: var(--st-accent-text); }
body.modal-open { overflow: hidden; }
.st-auth-mailicon { display: grid; place-items: center; width: 56px; height: 56px; margin: 0 auto 12px; border-radius: 50%; background: var(--st-accent-tint); color: var(--st-accent-text); }
.st-reset-toast { position: fixed; left: 50%; bottom: 24px; z-index: 300; width: min(440px, calc(100% - 32px)); transform: translateX(-50%); }

/* ══ Home (home.php) ═════════════════════════════════════════════════════ */

.st-switch { position: relative; display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 4px; color: var(--st-text-2); font: 600 var(--st-text-sm)/1 var(--st-font); white-space: nowrap; cursor: pointer; }
.st-switch input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.st-switch__track { position: relative; width: 32px; height: 18px; flex: none; border-radius: var(--st-radius-pill); background: var(--st-surface-3); box-shadow: inset 0 0 0 1px var(--st-line-strong); transition: background var(--st-fast) var(--st-ease); }
.st-switch__track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 12px; height: 12px; border-radius: 50%; background: var(--st-text-2); transition: transform var(--st-base) var(--st-ease), background var(--st-fast) var(--st-ease); }
.st-switch input:checked + .st-switch__track { background: var(--st-accent); box-shadow: none; }
.st-switch input:checked + .st-switch__track::after { transform: translateX(14px); background: #fff; }
.st-switch input:focus-visible + .st-switch__track { box-shadow: var(--st-focus); }
.st-switch:hover { color: var(--st-text); }

.st-sort { position: relative; display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 6px 0 10px; border: 1px solid var(--st-line); border-radius: var(--st-radius); background: var(--st-surface-2); color: var(--st-text-2); }
.st-sort:hover { border-color: var(--st-line-strong); }
.st-sort__select { height: 100%; padding: 0 4px; border: 0; background: transparent; color: var(--st-text); font: 600 var(--st-text-sm)/1 var(--st-font); cursor: pointer; }
.st-sort__select:focus { outline: none; }
.st-sort:focus-within { box-shadow: var(--st-focus); }
.st-sort__select option { background: var(--st-surface-2); color: var(--st-text); }

.st-filter-toggle[aria-expanded="true"] { border-color: var(--st-text-3); color: var(--st-text); }
.st-filter-count { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: var(--st-radius-pill); background: var(--st-accent); color: #fff; font: 700 11px/1 var(--st-font); }
.st-filters { margin: 0 0 var(--st-space-5); padding: var(--st-space-4); border: 1px solid var(--st-line); border-radius: var(--st-radius-lg); background: var(--st-surface-1); animation: st-rise var(--st-base) var(--st-ease); }
.st-filters.is-collapsed { display: none; }
.st-filters__fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); align-items: end; gap: var(--st-space-3); }
.st-filters .st-field { margin: 0; }
.st-filters .st-select, .st-filters .st-input { height: 36px; }
.st-filters__actions { display: flex; justify-content: flex-end; gap: var(--st-space-2); }

/* Community off: only Tom Pearl Originals and Memes */
body:not(.sc-show-community) #daily-section,
body:not(.sc-show-community) #hub-filter-panel,
body:not(.sc-show-community) .st-cats__tools,
body:not(.sc-show-community) .cat-btn:not(#cat-originals):not(#cat-tom-pearl-memes) { display: none !important; }
body.sc-show-community #cat-tom-pearl-memes { display: none !important; }

/* Hero: Tom Pearl intro (also the SEO copy) */
.st-hero { display: flow-root; margin: var(--st-space-4) 0 var(--st-space-3); padding: 14px 18px; border: 1px solid var(--st-line); border-left: 4px solid var(--st-accent); border-radius: var(--st-radius-lg); background: #1a0f18; }
.st-hero__portrait { float: right; width: 88px; height: 96px; margin: 0 0 8px 16px; border: 2px solid var(--st-accent); border-radius: 10px; object-fit: cover; object-position: center top; }
.st-hero h1 { margin: 0 0 6px; font: 700 clamp(21px, 2vw, 29px)/1.2 var(--st-font); letter-spacing: -.01em; }
.st-hero__lead { margin: 0; color: var(--st-text-2); font-size: var(--st-text-sm); }
.st-hero__rules { margin: 7px 0 0; color: var(--st-text-2); font-size: var(--st-text-xs); line-height: 1.5; }
.st-hero__rules strong { color: var(--st-gold); }
.st-hero__more { clear: both; }
.st-hero__more summary { display: list-item; width: fit-content; padding: 10px 0 2px; color: var(--st-accent-text); font-size: var(--st-text-xs); font-weight: 600; cursor: pointer; }
.st-hero__more summary:hover { color: var(--st-text); }
.st-hero__body { max-width: 900px; margin-top: var(--st-space-2); color: var(--st-text-2); font-size: var(--st-text-sm); line-height: 1.6; }
.st-hero__body p { margin: 0 0 10px; }
.st-hero__rules-title { display: block; color: var(--st-text); font-size: var(--st-text-xs); letter-spacing: .06em; text-transform: uppercase; }
.st-hero__list { margin: 6px 0 12px; padding-left: 18px; }
.st-hero__list li { margin: 4px 0; }
.st-hero__cats { display: flex; flex-wrap: wrap; gap: var(--st-space-2); margin-top: var(--st-space-3); }

/* "Show other extreme videos too": the 18+ opt-in to the community archive */
.st-choice { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px 20px; margin: 0 0 var(--st-space-4); padding: 14px 18px; border: 1px solid #8b4b20; border-left: 4px solid #ff9500; border-radius: var(--st-radius-lg); background: #1b110b; }
.st-choice strong { display: block; font-size: var(--st-text-lg); line-height: 1.35; }
.st-choice p { margin: 4px 0 0; color: #cbb9aa; font-size: var(--st-text-sm); line-height: 1.5; }
.st-choice__toggle { display: flex; align-items: center; gap: 10px; min-height: 44px; font-size: var(--st-text-sm); font-weight: 700; cursor: pointer; }
.st-choice__toggle input { width: 20px; height: 20px; flex: none; margin: 0; accent-color: #ff9500; cursor: pointer; }

/* Category pills */
.st-cats { display: flex; gap: var(--st-space-2); margin: 0 0 var(--st-space-4); padding: 2px; overflow-x: auto; scrollbar-width: none; }
.st-cats::-webkit-scrollbar { display: none; }
.st-cat { display: inline-flex; flex: none; align-items: center; gap: 7px; min-height: 44px; padding: 0 16px; border: 1px solid var(--st-line-strong); border-radius: var(--st-radius-pill); background: var(--st-surface-1); color: var(--st-text); font: 600 var(--st-text-sm)/1 var(--st-font); white-space: nowrap; cursor: pointer; transition: border-color var(--st-fast) var(--st-ease), background var(--st-fast) var(--st-ease); }
.st-cat:hover { border-color: var(--st-accent-text); }
.st-cat:active { transform: scale(.97); }
.st-cat .st-ico { color: var(--st-accent-text); }
.st-cat.active { border-color: var(--st-accent); background: var(--st-accent); color: #17000e; }
.st-cat.active .st-ico { color: currentColor; }
.st-cat__img { width: 20px; height: 20px; margin-left: -4px; border-radius: 50%; object-fit: cover; }
#cat-originals { border-color: rgba(255, 216, 74, .5); color: var(--st-gold); }
#cat-originals.active { border-color: var(--st-gold); background: var(--st-gold); color: #1b1000; }
.st-cats__tools { display: flex; flex-wrap: wrap; align-items: center; gap: var(--st-space-2); margin: calc(-1 * var(--st-space-1)) 0 var(--st-space-4); }

/* Shit eater of the day: one compact row (community archive only) */
.st-daily { margin: 0 0 var(--st-space-4); }
.st-daily__inner { display: flex; align-items: center; gap: var(--st-space-3); max-width: 760px; padding: 8px 12px 8px 8px; border: 1px solid rgba(255, 216, 74, .28); border-radius: var(--st-radius-lg); background: #17110a; }
.st-daily__thumb { position: relative; flex: none; display: block; width: 112px; aspect-ratio: 16 / 9; overflow: hidden; border-radius: var(--st-radius); background: var(--st-surface-2); }
.st-daily__thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.st-daily__info { display: flex; flex: 1; flex-direction: column; gap: 4px; min-width: 0; }
.st-daily__info .st-skel--line { margin: 0; }
.st-daily__kicker { display: inline-flex; align-items: center; gap: 5px; color: var(--st-gold); font: 700 11px/1 var(--st-font); letter-spacing: .08em; text-transform: uppercase; }
.st-daily__title { overflow: hidden; font-size: var(--st-text-md); font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.st-daily__title:hover { color: var(--st-accent-text); }
.st-daily__go { flex: none; }

.st-thumb { position: relative; display: block; aspect-ratio: 16 / 9; overflow: hidden; border-radius: var(--st-radius); background: var(--st-surface-2); }
.st-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform var(--st-base) var(--st-ease), opacity var(--st-fast) var(--st-ease); }
.st-thumb.is-watched img { opacity: .55; }
.st-thumb.is-watched::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--st-accent); }
.st-thumb__seen { position: absolute; left: 6px; bottom: 9px; padding: 2px 5px; border-radius: var(--st-radius-sm); background: rgba(0, 0, 0, .82); color: #fff; font: 600 11px/1.2 var(--st-font); }
.st-thumb.is-watched .st-duration { bottom: 9px; }
@media (hover: hover) {
  .st-vcard:hover .st-thumb img, .st-scard:hover .st-scard__thumb img { transform: scale(1.03); }
}

.st-skel--short { width: 58%; }

.st-scard { display: flex; flex-direction: column; gap: 8px; color: var(--st-text); }
.st-scard__thumb { position: relative; display: block; aspect-ratio: 9 / 16; overflow: hidden; border-radius: var(--st-radius); background: var(--st-surface-2); }
.st-scard__thumb img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform var(--st-base) var(--st-ease); }
.st-scard__views { position: absolute; left: 6px; bottom: 6px; display: inline-flex; align-items: center; gap: 4px; padding: 3px 6px 3px 4px; border-radius: var(--st-radius-sm); background: rgba(0, 0, 0, .78); color: #fff; font: 600 var(--st-text-xs)/1 var(--st-font); font-variant-numeric: tabular-nums; }
.st-scard__views .st-ico { width: 14px; height: 14px; fill: currentColor; stroke: none; }
.st-scard__title { overflow-wrap: anywhere; display: -webkit-box; overflow: hidden; -webkit-line-clamp: 2; -webkit-box-orient: vertical; font: 600 var(--st-text-sm)/1.4 var(--st-font); }

/* Main feed */
.st-feed { margin-top: var(--st-space-2); }
.st-feed__head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px var(--st-space-3); margin: 0 0 var(--st-space-4); padding-bottom: 10px; border-bottom: 1px solid var(--st-line); }
.st-feed__head h2 { margin: 0; font: 400 28px/1 var(--st-font-display); letter-spacing: .06em; text-transform: uppercase; }
.st-feed__head > span { color: var(--st-text-3); font-size: var(--st-text-sm); }
.st-feed__head > span:empty { display: none; }
.st-feed__head #hub-results-status { flex: 1 1 auto; flex-basis: auto; text-align: right; color: var(--st-text-2); font-size: var(--st-text-xs); }
.st-section-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px var(--st-space-3); margin: 0 0 var(--st-space-4); }
.st-section-head h2 { margin: 0; font: 700 var(--st-text-xl)/1.2 var(--st-font); }
.st-section-head > span { color: var(--st-text-3); font-size: var(--st-text-sm); }
.st-section-head > span:empty { display: none; }
#hub-results-status { flex-basis: 100%; color: var(--st-text-2); font-size: var(--st-text-sm); }
#hub-results-status:empty { display: none; }
.st-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(268px, 1fr)); gap: var(--st-space-8) var(--st-space-4); }
.st-grid + .st-grid:not(:empty) { margin-top: var(--st-space-8); }
#gridSkeleton + #videoGrid { margin-top: 0; }

.st-vcard { position: relative; display: flex; flex-direction: column; gap: var(--st-space-3); min-width: 0; }
.st-vcard__body { position: relative; display: grid; grid-template-columns: 36px minmax(0, 1fr) 32px; align-items: start; gap: var(--st-space-3); }
.st-vcard__avatar { display: block; }
.st-vcard__avatar .st-avatar { display: block; }
.st-vcard__text { min-width: 0; }
.st-vcard__title { overflow-wrap: anywhere; display: -webkit-box; overflow: hidden; -webkit-line-clamp: 2; -webkit-box-orient: vertical; margin: 0 0 4px; font: 600 var(--st-text-lg)/1.35 var(--st-font); }
.st-vcard__channel { display: inline-flex; align-items: center; max-width: 100%; color: var(--st-text-2); font-size: var(--st-text-sm); }
.st-vcard__channel:hover { color: var(--st-text); }
.st-vcard__meta { color: var(--st-text-3); font-size: var(--st-text-sm); }
.st-vcard__desc { display: none; margin: 8px 0 0; overflow: hidden; color: var(--st-text-3); font-size: var(--st-text-sm); line-height: 1.45; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.st-vcard__labels { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.st-vcard__label { background: var(--st-violet-tint); color: var(--st-violet); text-transform: capitalize; }
.st-vcard__menu { margin: -4px -8px 0 0; }
@media (hover: hover) {
  .st-vcard__menu { opacity: 0; transition: opacity var(--st-fast) var(--st-ease); }
  .st-vcard:hover .st-vcard__menu, .st-vcard:focus-within .st-vcard__menu, .st-vcard__menu[aria-expanded="true"] { opacity: 1; }
}
.st-vcard--skel .st-vcard__body { grid-template-columns: 36px minmax(0, 1fr); }
.st-vcard--skel .st-avatar { width: 36px; height: 36px; border-radius: 50%; }
.st-vcard--skel .st-skel--line:first-child { margin-top: 2px; }
.feed-reco-menu { display: none; top: 30px; right: -8px; min-width: 232px; }
.feed-reco-menu.is-open { display: block; }
.st-feed__state { grid-column: 1 / -1; }
.st-feed__state > .st-spinner { display: block; margin: var(--st-space-10) auto; }

/* Home sections hidden while browsing a library */
body.scatube-library-mode .seo-home-only,
body.scatube-library-mode .sc-view-choice,
body.scatube-library-mode .cat-bar-wrap,
body.scatube-library-mode .st-cats__tools,
body.scatube-library-mode #hub-filter-panel,
body.scatube-library-mode #daily-section,
body.scatube-library-mode #join-cta-banner,
body.scatube-library-mode #gridSkeleton,
body.scatube-library-mode .st-archive { display: none !important; }
body.scatube-library-mode .st-feed { padding-top: var(--st-space-6); }

/* After the feed */
.st-join { display: flex; align-items: center; gap: var(--st-space-3); margin: var(--st-space-10) 0 var(--st-space-8); padding: 12px 16px; border: 1px solid var(--st-line); border-left: 3px solid var(--st-accent); border-radius: var(--st-radius-lg); background: var(--st-surface-1); }
.st-join__img { width: 40px; height: 40px; border: 2px solid #ff4500; }
.st-join__text strong { display: flex; align-items: center; gap: 6px; font: 600 var(--st-text-md)/1.3 var(--st-font); }
.st-join__tom { width: 18px; height: 18px; border-radius: 50%; object-fit: cover; }
.st-join__text span { color: var(--st-text-2); font-size: var(--st-text-xs); }
.st-join__actions { display: flex; gap: var(--st-space-2); margin-left: auto; }
.st-archive { margin-top: var(--st-space-10); padding-top: var(--st-space-6); border-top: 1px solid var(--st-line); }
.st-archive h2 { margin: 0 0 var(--st-space-3); color: var(--st-text-2); font: 700 var(--st-text-xl)/1.3 var(--st-font); }
.st-archive ul { margin: 0; padding: 0; list-style: none; column-width: 260px; column-gap: var(--st-space-6); }
.st-archive li { overflow: hidden; margin: 0 0 6px; font-size: var(--st-text-sm); text-overflow: ellipsis; white-space: nowrap; break-inside: avoid; }
.st-archive a { color: var(--st-text-3); }
.st-archive a:hover { color: var(--st-text); }
.st-footer { margin-top: var(--st-space-8); padding: var(--st-space-6) 0 var(--st-space-4); border-top: 1px solid var(--st-line); color: var(--st-text-3); font-size: var(--st-text-xs); line-height: 1.6; text-align: center; }
.st-footer p { max-width: 760px; margin: 0 auto 8px; }
.st-footer__warn { display: flex; align-items: center; justify-content: center; gap: 6px; color: #ff6a1a; font-size: var(--st-text-md); }
.st-footer__rules { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px var(--st-space-4); margin: 0 0 8px; padding: 0; list-style: none; }
.st-footer__rules li { display: inline-flex; align-items: center; gap: 4px; }
.st-footer__rules .st-ico { color: var(--st-danger); }
.st-footer__rules strong { color: var(--st-text-2); }
.st-footer nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px var(--st-space-4); margin-top: var(--st-space-3); }
.st-footer nav a:hover { color: var(--st-text); }

/* ── Responsive ── */
@media (max-width: 900px) {
  .st-live { display: none; }
}
@media (max-width: 768px) {
  .st-header { gap: var(--st-space-2); padding: 0 var(--st-space-2); }
  .st-logo__word { font-size: 27px; }
  .st-logo__site, .st-header__join { display: none; }
  .st-search { display: none; }
  .st-header__search-open { display: inline-grid; }
  .st-header__upload { width: 40px; min-height: 36px; padding: 0; }
  .st-header__upload > span, .st-header__signin > .st-ico { display: none; }
  .st-header__signin { min-height: 34px; padding: 0 12px; }
  body.st-search-open .st-search { position: absolute; inset: 0; z-index: 3; display: flex; max-width: none; margin: 0; padding: 0 var(--st-space-2); background: var(--st-bg); }
  body.st-search-open .st-search__back { display: inline-grid; }
  .st-search__go { display: none; }
  .st-main { padding: 0 var(--st-space-3) var(--st-space-8); }
  .st-hero { margin-top: var(--st-space-3); padding: 12px 14px; }
  .st-hero h1 { font-size: 20px; }
  .st-hero__portrait { width: 64px; height: 75px; margin-left: 12px; }
  .st-choice { grid-template-columns: minmax(0, 1fr); gap: 8px; padding: 12px 14px; }
  .st-choice__toggle { padding-top: 8px; border-top: 1px solid #63412d; }
  .st-cats { margin-right: calc(-1 * var(--st-space-3)); padding-right: var(--st-space-3); }
  .st-section-head h2 { font-size: var(--st-text-lg); }
  .st-feed__head h2 { font-size: 24px; }
  .st-grid { gap: var(--st-space-6) var(--st-space-4); }
  .st-join { flex-wrap: wrap; }
  .st-join__actions { width: 100%; margin-left: 0; }
  .st-join__actions .st-btn { flex: 1; }
  .st-vcard__menu { opacity: 1; }
}
@media (max-width: 560px) {
  .st-sort > .st-ico { display: none; }
  .st-sort { padding-left: 4px; }
  .st-promo { font-size: var(--st-text-xs); }
  .st-promo__link span:not(.st-promo__cta) { display: none; }
  .st-grid { grid-template-columns: minmax(0, 1fr); }
  .st-daily__thumb { width: 88px; }
  .st-daily__go { display: none; }
  .st-gate { padding: var(--st-space-5); }
}
@media (prefers-reduced-motion: reduce) {
  .st-body *, .st-body *::before, .st-body *::after { animation-duration: 1ms !important; transition-duration: 1ms !important; }
}

/* ── Watch page (page1.php) ── */
.st-watch { display: grid; grid-template-columns: minmax(0, 1fr) 402px; gap: var(--st-space-6); max-width: 1760px; margin: 0 auto; padding-top: var(--st-space-6); }
.st-watch__primary { min-width: 0; }

.st-player { position: relative; overflow: hidden; border-radius: var(--st-radius-lg); background: #000; }
#mainPlayer { display: block; width: 100%; aspect-ratio: 16 / 9; max-height: calc(100vh - var(--st-header-h) - 140px); min-height: 200px; background: #000; }
#mainPlayer.video-sticky { position: fixed; right: 16px; bottom: 24px; z-index: 95; width: 320px !important; min-height: 0; max-height: none; border-radius: var(--st-radius); box-shadow: var(--st-shadow-pop); }
#player-placeholder { display: none; width: 100%; }
.st-sticky-close { position: fixed; right: 20px; bottom: 214px; z-index: 96; background: rgba(0, 0, 0, .78); color: #fff; }
.st-player__overlay { position: absolute; inset: 0; z-index: 9; flex-direction: column; align-items: center; justify-content: center; gap: var(--st-space-4); padding: var(--st-space-5); background: rgba(8, 6, 9, .9); color: var(--st-text); text-align: center; }
.st-endcard__kicker { color: var(--st-text-2); font: 600 var(--st-text-xs)/1 var(--st-font); letter-spacing: .08em; text-transform: uppercase; }
.st-endcard__card { display: flex; align-items: center; gap: var(--st-space-4); width: 100%; max-width: 480px; padding: var(--st-space-3); border: 1px solid var(--st-line-strong); border-radius: var(--st-radius-lg); background: var(--st-surface-1); cursor: pointer; text-align: left; transition: border-color var(--st-fast) var(--st-ease); }
.st-endcard__card:hover, .st-endcard__card:focus-visible { border-color: var(--st-accent); }
.st-endcard__card img { width: 144px; flex: none; aspect-ratio: 16 / 9; object-fit: cover; border-radius: var(--st-radius); }
.st-endcard__text { min-width: 0; }
.st-endcard__title { display: -webkit-box; overflow: hidden; -webkit-line-clamp: 2; -webkit-box-orient: vertical; margin-bottom: 4px; font: 600 var(--st-text-md)/1.35 var(--st-font); }
.st-endcard__meta { color: var(--st-text-2); font-size: var(--st-text-sm); }
.st-endcard__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--st-space-3); }
.st-endcard__count { margin-left: -2px; opacity: .8; font-variant-numeric: tabular-nums; }
.st-adbreak__card { display: flex; flex-direction: column; align-items: center; gap: 6px; color: var(--st-text); }
.st-adbreak__card img { width: 150px; height: auto; margin-bottom: 6px; border: 1px solid var(--st-gold); border-radius: var(--st-radius); }
.st-adbreak__card strong { color: var(--st-gold); font: 600 var(--st-text-lg)/1.2 var(--st-font); }
.st-adbreak__card span { color: var(--st-text-2); font-size: var(--st-text-sm); }
.st-adbreak__skip { position: absolute; right: 0; bottom: 28px; border-radius: var(--st-radius) 0 0 var(--st-radius); }

.st-watch__meta { padding-top: var(--st-space-4); }
.st-watch__title { margin: 0; overflow-wrap: anywhere; color: var(--st-text); font: 700 var(--st-text-xl)/1.35 var(--st-font); }
.st-watch__bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--st-space-3) var(--st-space-5); margin-top: var(--st-space-3); }
.st-watch__channel { display: flex; align-items: center; gap: var(--st-space-3); min-width: 0; }
.st-watch__pfp { flex: none; line-height: 0; }
.st-watch__pfp .st-avatar { width: 40px; height: 40px; }
.st-watch__who { display: flex; flex-direction: column; min-width: 0; margin-right: var(--st-space-2); }
.st-watch__who a { overflow: hidden; color: var(--st-text); font: 600 var(--st-text-md)/1.35 var(--st-font); text-overflow: ellipsis; white-space: nowrap; }
.st-watch__who a:hover { color: var(--st-accent-text); }
.st-watch__who > span { color: var(--st-text-3); font-size: var(--st-text-xs); }
.st-watch__actions { display: flex; align-items: center; gap: var(--st-space-2); min-width: 0; overflow-x: auto; scrollbar-width: none; }
.st-watch__actions::-webkit-scrollbar { display: none; }
.st-watch__actions > * { flex: none; }
.st-watch__actions .st-btn, .st-watch__channel .st-btn { height: 36px; border-radius: var(--st-radius-pill); }
.st-watch__actions .st-vote__btn > span:empty { display: none; }
#btn-watch-later[aria-pressed="true"] { color: var(--st-accent-text); }
.channel-bell[data-mode="all"] { color: var(--st-text); }

.st-watch__desc { margin-top: var(--st-space-4); padding: var(--st-space-3) var(--st-space-4); border-radius: var(--st-radius-lg); background: var(--st-surface-2); color: var(--st-text); font-size: var(--st-text-md); line-height: 1.55; }
.st-watch__stats { display: flex; flex-wrap: wrap; gap: 0 var(--st-space-3); margin-bottom: 4px; font-weight: 600; }
.st-watch__labels { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 8px; }
.st-watch__labels .st-badge { text-transform: capitalize; }
.st-watch__desc-short { cursor: pointer; overflow-wrap: anywhere; }
.st-watch__desc-full { overflow-wrap: anywhere; }
.st-watch__desc-toggle { padding: 0; border: 0; background: none; color: var(--st-text); font: 600 var(--st-text-md)/1.55 var(--st-font); cursor: pointer; }
.st-watch__desc-short .st-watch__desc-toggle { margin-left: 4px; }
.st-watch__desc-toggle:hover { color: var(--st-accent-text); }
.st-watch__links { display: flex; flex-wrap: wrap; gap: var(--st-space-4); margin: var(--st-space-3) 0; }
.st-watch__links a { display: inline-flex; align-items: center; gap: 6px; color: var(--st-accent-text); }
.st-watch__links a:hover { text-decoration: underline; }

.st-watch__merch { display: flex; align-items: center; gap: var(--st-space-4); margin-top: var(--st-space-4); padding: var(--st-space-3) var(--st-space-4); border: 1px solid var(--st-line); border-left: 3px solid var(--st-gold); border-radius: var(--st-radius-lg); background: var(--st-surface-1); color: var(--st-text); transition: border-color var(--st-fast) var(--st-ease); }
.st-watch__merch:hover { border-color: var(--st-line-strong); border-left-color: var(--st-gold); }
.st-watch__merch img { width: 56px; height: 56px; flex: none; object-fit: cover; border-radius: var(--st-radius); }
.st-watch__merch-text { display: flex; flex: 1; flex-direction: column; gap: 2px; min-width: 0; }
.st-watch__merch-text strong { color: var(--st-gold); font: 600 var(--st-text-md)/1.3 var(--st-font); }
.st-watch__merch-text span { color: var(--st-text-2); font-size: var(--st-text-sm); }

.st-comments { margin-top: var(--st-space-6); }
.st-comments__head { display: flex; align-items: center; gap: var(--st-space-5); margin-bottom: var(--st-space-5); }
.st-comments__head h2 { margin: 0; font: 700 var(--st-text-xl)/1.3 var(--st-font); }
.st-comments__sort { display: inline-flex; align-items: center; gap: 6px; color: var(--st-text-2); }
.st-comments__sort .st-select { width: auto; height: 32px; padding-top: 0; padding-bottom: 0; font-size: var(--st-text-sm); }
.st-comments__state { margin: 0; padding: var(--st-space-5) 0; color: var(--st-text-3); font-size: var(--st-text-sm); }
.st-comments__more { padding: var(--st-space-3) 0; }
.st-compose { display: flex; gap: var(--st-space-3); margin-bottom: var(--st-space-6); }
.st-compose .st-avatar { width: 40px; height: 40px; }
.st-compose__body { flex: 1; min-width: 0; }
.st-compose__input { width: 100%; padding: 6px 0; border: 0; border-bottom: 1px solid var(--st-line-strong); border-radius: 0; background: transparent; color: var(--st-text); font: var(--st-text-md)/1.4 var(--st-font); outline: none; transition: border-color var(--st-fast) var(--st-ease); }
.st-compose__input:focus { border-bottom-color: var(--st-text); }
.st-compose__actions { display: none; justify-content: flex-end; gap: var(--st-space-2); margin-top: var(--st-space-2); }
.st-compose:focus-within .st-compose__actions, .st-compose:has(.st-compose__input:not(:placeholder-shown)) .st-compose__actions { display: flex; }
.st-comment { display: flex; gap: var(--st-space-3); margin-bottom: var(--st-space-5); scroll-margin-top: calc(var(--st-header-h) + 24px); }
.st-comment > a { flex: none; line-height: 0; }
.st-comment .st-avatar { width: 40px; height: 40px; }
.st-comment--reply { margin-left: 52px; }
.st-comment--reply .st-avatar { width: 28px; height: 28px; }
.st-comment:target .st-comment__body { border-radius: var(--st-radius); box-shadow: -8px 0 0 var(--st-surface-2), 8px 0 0 var(--st-surface-2); background: var(--st-surface-2); }
.st-comment__body { flex: 1; min-width: 0; }
.st-comment__ctx, .st-comment__pin { display: flex; align-items: center; gap: 6px; margin-bottom: 2px; color: var(--st-text-3); font-size: var(--st-text-xs); }
.st-comment__ctx a { color: var(--st-text-2); }
.st-comment__head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px var(--st-space-2); }
.st-comment__author { color: var(--st-text); font: 600 var(--st-text-sm)/1.4 var(--st-font); }
a.st-comment__author:hover { color: var(--st-accent-text); }
.st-comment__author.is-creator { padding: 0 8px; border-radius: var(--st-radius-pill); background: var(--st-surface-3); }
.st-comment__date { color: var(--st-text-3); font-size: var(--st-text-xs); }
.st-comment__date:hover { color: var(--st-text-2); }
.st-comment__text { margin: 2px 0 4px; overflow-wrap: anywhere; color: var(--st-text); font-size: var(--st-text-md); line-height: 1.5; white-space: pre-line; }
.st-comment__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; margin-left: -8px; }
.st-comment__act { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 8px; border: 0; border-radius: var(--st-radius-pill); background: none; color: var(--st-text-2); font: 600 var(--st-text-xs)/1 var(--st-font); cursor: pointer; transition: background var(--st-fast) var(--st-ease), color var(--st-fast) var(--st-ease); }
.st-comment__act:hover { background: var(--st-surface-3); color: var(--st-text); }
.st-comment__act:disabled { opacity: .5; cursor: default; }
.st-comment__act.is-on, .st-comment__hearted { color: var(--st-accent-text); }
.st-comment__act.sc-comment-delete:hover { color: var(--st-danger); }
.st-comment__hearted { display: inline-flex; align-items: center; gap: 4px; padding: 0 8px; font-size: var(--st-text-xs); font-weight: 600; }
.st-reply { margin-top: var(--st-space-2); }
.st-reply .st-textarea { min-height: 64px; }
.st-reply__actions { display: flex; justify-content: flex-end; gap: var(--st-space-2); margin-top: var(--st-space-2); }
.comment-mention { color: var(--st-accent-text); font-weight: 600; }
.comment-mention:hover { text-decoration: underline; }
.mention-suggestions { position: absolute; z-index: 12000; overflow: hidden; border: 1px solid var(--st-line-strong); border-radius: var(--st-radius); background: var(--st-surface-2); box-shadow: var(--st-shadow-pop); }
.mention-suggestions[hidden] { display: none; }
.mention-suggestion { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 12px; border: 0; background: transparent; color: var(--st-text); text-align: left; cursor: pointer; }
.mention-suggestion:hover, .mention-suggestion.active { background: var(--st-surface-hover); }
.mention-suggestion img { border-radius: 50%; object-fit: cover; }
.mention-suggestion span { min-width: 0; }
.mention-suggestion strong, .mention-suggestion small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mention-suggestion strong { font-size: var(--st-text-sm); }
.mention-suggestion small { margin-top: 2px; color: var(--st-text-3); font-size: 11px; }

.st-comment-gate { display: grid; grid-template-columns: 200px minmax(0, 1fr); align-items: center; gap: var(--st-space-5); margin-bottom: var(--st-space-6); padding: var(--st-space-4); border: 1px solid var(--st-line); border-radius: var(--st-radius-lg); background: var(--st-surface-1); }
.st-comment-gate img { width: 100%; height: auto; border-radius: var(--st-radius); }
.st-comment-gate__copy { display: flex; flex-direction: column; gap: 6px; }
.st-comment-gate__eyebrow { color: var(--st-accent-text); font: 600 var(--st-text-xs)/1.2 var(--st-font); letter-spacing: .06em; text-transform: uppercase; }
.st-comment-gate__copy strong { font: 600 var(--st-text-lg)/1.3 var(--st-font); }
.st-comment-gate__copy p { margin: 0; color: var(--st-text-2); font-size: var(--st-text-sm); line-height: 1.5; }
.st-comment-gate__actions { display: flex; flex-wrap: wrap; gap: var(--st-space-2); margin-top: var(--st-space-2); }

.st-watch__cta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--st-space-4); margin: var(--st-space-6) 0; padding: var(--st-space-5); border: 1px solid var(--st-line); border-radius: var(--st-radius-lg); background: var(--st-surface-1); }
.st-watch__cta > div { display: flex; flex-direction: column; gap: 4px; }
.st-watch__cta-kicker { color: var(--st-accent-text); font: 600 var(--st-text-xs)/1.2 var(--st-font); letter-spacing: .06em; text-transform: uppercase; }
.st-watch__cta strong { font: 400 26px/1.1 var(--st-font-display); letter-spacing: .02em; }
.st-watch__cta p { margin: 0; color: var(--st-text-2); font-size: var(--st-text-sm); }

.st-watch__side { min-width: 0; }
.st-watch__side-head { display: flex; align-items: center; gap: var(--st-space-2); margin-bottom: var(--st-space-3); }
.st-watch__side-head h2 { flex: 1; margin: 0; font: 700 var(--st-text-lg)/1.3 var(--st-font); }
/* "Next cursed video" bar under the player */
.p1-mast { display: flex; align-items: center; gap: 9px; margin: 0 0 10px; color: var(--st-accent-text); font: 700 10px/1 var(--st-font); letter-spacing: .18em; text-transform: uppercase; }
.p1-mast span { padding: 5px 8px; border-radius: var(--st-radius-sm); background: var(--st-accent); color: #18000f; }
.p1-mast i { width: 8px; height: 8px; border-radius: 50%; background: var(--st-success); box-shadow: 0 0 0 3px var(--st-success-tint); }
.p1-session-loop { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: var(--st-space-3) 0 0; padding: 10px; border: 1px solid rgba(255, 36, 184, .3); border-radius: var(--st-radius-lg); background: #1a0f18; }
.p1-next-cursed { font-weight: 800; letter-spacing: .02em; text-transform: uppercase; }
.p1-auto { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 12px; border: 1px solid var(--st-line-strong); border-radius: var(--st-radius); font-size: var(--st-text-sm); font-weight: 700; cursor: pointer; }
.p1-auto input { width: 18px; height: 18px; margin: 0; accent-color: var(--st-accent); }
.p1-session-count { margin-left: auto; color: var(--st-accent-text); font: 700 11px/1.2 var(--st-font); letter-spacing: .12em; text-transform: uppercase; }
@media (max-width: 600px) {
  .p1-session-loop { display: grid; grid-template-columns: 1fr auto; }
  .p1-session-count { grid-column: 1 / -1; margin: 0; text-align: center; }
}
.st-upnext { display: flex; flex-direction: column; gap: var(--st-space-2); }
.st-upnext__empty { margin: 0; color: var(--st-text-3); font-size: var(--st-text-sm); }
.st-ncard { display: grid; grid-template-columns: 168px minmax(0, 1fr); gap: var(--st-space-2); padding: 4px; margin: -4px; border-radius: var(--st-radius); color: var(--st-text); }
.st-ncard:hover { background: var(--st-surface-1); }
.st-ncard .st-thumb { border-radius: var(--st-radius); }
.st-ncard__body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.st-ncard__title { overflow-wrap: anywhere; display: -webkit-box; overflow: hidden; -webkit-line-clamp: 2; -webkit-box-orient: vertical; font: 600 var(--st-text-sm)/1.4 var(--st-font); }
.st-ncard__channel { overflow: hidden; width: fit-content; max-width: 100%; color: var(--st-text-3); font-size: var(--st-text-xs); text-overflow: ellipsis; white-space: nowrap; }
.st-ncard__channel:hover { color: var(--st-text); }
.st-ncard__meta { color: var(--st-text-3); font-size: var(--st-text-xs); }
.st-ncard--skel { pointer-events: none; }
.st-ncard--skel .st-skel--line { margin-top: 0; }
.p1-originals-mini { margin-bottom: var(--st-space-5); padding: var(--st-space-3); border: 1px solid var(--st-line); border-radius: var(--st-radius-lg); background: var(--st-surface-1); }
.p1-originals-mini header { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--st-space-3); }
.p1-originals-mini h2 { margin: 0; color: var(--st-gold); font: 400 20px/1 var(--st-font-display); letter-spacing: .04em; }
.p1-originals-mini header a { color: var(--st-text-2); font-size: var(--st-text-xs); font-weight: 600; }
.p1-originals-mini header a:hover { color: var(--st-text); }
.p1-originals-mini-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--st-space-3) var(--st-space-2); }
.p1-originals-mini-note { grid-column: 1 / -1; color: var(--st-text-3); font-size: var(--st-text-xs); }
.p1-original-mini { display: flex; flex-direction: column; gap: 4px; color: var(--st-text-2); font-size: 11px; line-height: 1.3; }
.p1-original-mini > span:last-child { display: -webkit-box; overflow: hidden; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: anywhere; }
.p1-original-mini:hover { color: var(--st-text); }

.st-watch__more { max-width: 1760px; margin: var(--st-space-8) auto 0; padding-top: var(--st-space-5); border-top: 1px solid var(--st-line); }
.st-watch__more h2 { margin: 0 0 var(--st-space-3); color: var(--st-text-2); font: 600 var(--st-text-sm)/1.3 var(--st-font); }
.st-watch__more ul { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 0 var(--st-space-5); margin: 0; padding: 0; list-style: none; }
.st-watch__more li { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-watch__more a { color: var(--st-text-3); font-size: var(--st-text-xs); line-height: 2; }
.st-watch__more a:hover { color: var(--st-text); }

.st-policy { position: fixed; inset: 0; z-index: 9999; align-items: center; justify-content: center; padding: var(--st-space-4); background: rgba(5, 4, 6, .86); }
.st-policy__box { position: relative; width: 100%; max-width: 480px; max-height: calc(100vh - 32px); overflow-y: auto; padding: var(--st-space-6); border: 1px solid var(--st-line-strong); border-radius: var(--st-radius-lg); background: var(--st-surface-1); box-shadow: var(--st-shadow-pop); animation: st-pop var(--st-base) var(--st-ease); }
.st-policy__close { position: absolute; top: 12px; right: 12px; }
.st-policy h2 { margin: 0 0 var(--st-space-2); font: 700 var(--st-text-xl)/1.3 var(--st-font); }
.st-policy p { margin: 0 0 var(--st-space-3); color: var(--st-text-2); font-size: var(--st-text-sm); line-height: 1.55; }
.st-policy p strong { color: var(--st-text); }
.st-policy__rules { display: flex; flex-direction: column; gap: 6px; margin: 0 0 var(--st-space-4); padding: 0; list-style: none; font-size: var(--st-text-sm); }
.st-policy__rules li { display: flex; align-items: flex-start; gap: 8px; }
.st-policy__rules .st-ico { margin-top: 2px; color: var(--st-danger); }
.st-policy__rules li.is-ok { color: var(--st-text-2); }
.st-policy__rules li.is-ok .st-ico { color: var(--st-success); }
.st-policy__link { display: inline-flex; align-items: center; gap: 6px; margin-bottom: var(--st-space-4); color: var(--st-accent-text); font-size: var(--st-text-sm); }
.st-policy__agree { display: flex; align-items: flex-start; gap: 10px; margin-bottom: var(--st-space-4); color: var(--st-text); font-size: var(--st-text-sm); line-height: 1.5; cursor: pointer; }
.st-policy__agree input { width: 16px; height: 16px; margin-top: 2px; flex: none; accent-color: var(--st-accent); }
.st-policy__agree a { color: var(--st-accent-text); }

.st-nudge { position: fixed; left: 50%; bottom: 24px; z-index: 92; align-items: center; gap: var(--st-space-3); width: min(420px, calc(100vw - 24px)); padding: var(--st-space-3); border: 1px solid var(--st-line-strong); border-radius: var(--st-radius-lg); background: var(--st-surface-2); box-shadow: var(--st-shadow-pop); transform: translateX(-50%); animation: st-rise var(--st-base) var(--st-ease); }
.st-nudge img { width: 36px; height: 36px; flex: none; border-radius: 50%; object-fit: cover; }
.st-nudge__text { display: flex; flex: 1; flex-direction: column; gap: 2px; min-width: 0; }
.st-nudge__text strong { font-size: var(--st-text-sm); }
.st-nudge__text span { color: var(--st-text-2); font-size: var(--st-text-xs); line-height: 1.4; }

@media (max-width: 1300px) {
  .st-watch { grid-template-columns: minmax(0, 1fr) 360px; }
  .st-ncard { grid-template-columns: 148px minmax(0, 1fr); }
}
@media (max-width: 1000px) {
  .st-watch { grid-template-columns: minmax(0, 1fr); }
  #mainPlayer { max-height: 70vh; }
  .st-ncard { grid-template-columns: 200px minmax(0, 1fr); }
}
@media (max-width: 768px) {
  .st-watch-page .st-main { padding-left: 0; padding-right: 0; }
  .st-watch { padding-top: 0; gap: var(--st-space-5); }
  .st-watch__primary > :not(.st-player), .st-watch__side, .st-watch__more { margin-left: var(--st-space-3); margin-right: var(--st-space-3); }
  .st-watch__primary > #player-placeholder { margin: 0; }
  .st-player { border-radius: 0; }
  #mainPlayer { max-height: 56vh; }
  #mainPlayer.video-sticky { width: 200px !important; right: 8px; bottom: calc(72px + env(safe-area-inset-bottom)); }
  .st-sticky-close { right: 12px; bottom: calc(72px + 113px + 8px + env(safe-area-inset-bottom)); }
  .st-watch__title { font-size: var(--st-text-lg); }
  .st-watch__bar { flex-direction: column; flex-wrap: nowrap; align-items: stretch; }
  .st-watch__channel { flex-wrap: nowrap; }
  .st-watch__who { flex: 1; }
  .st-watch__actions { margin: 0 calc(-1 * var(--st-space-3)); padding: 0 var(--st-space-3); }
  .st-ncard { grid-template-columns: 160px minmax(0, 1fr); }
  .st-comment-gate { grid-template-columns: minmax(0, 1fr); }
  .st-comment-gate img { max-width: 260px; }
  .st-comment--reply { margin-left: 40px; }
  .st-nudge { bottom: calc(72px + env(safe-area-inset-bottom)); }
}
@media (max-width: 480px) {
  .st-ncard { grid-template-columns: 140px minmax(0, 1fr); }
  .st-endcard__card img { width: 104px; }
  .st-watch__merch .st-btn { display: none; }
}

/* ══ Search results (results.php + results.js) ═══════════════ */
.st-results { width: 100%; max-width: 1144px; margin: 0 auto; }
.st-results__loading { position: fixed; top: var(--st-header-h); left: 0; right: 0; z-index: 90; height: 3px; overflow: hidden; pointer-events: none; }
.st-results__loading span { display: block; width: 35%; height: 100%; background: var(--st-accent); box-shadow: 0 0 10px var(--st-accent); animation: st-indeterminate 1.1s var(--st-ease) infinite; }
.st-results__bar { position: sticky; top: var(--st-header-h); z-index: 20; display: flex; align-items: center; gap: var(--st-space-3); padding: var(--st-space-3) 0; background: var(--st-bg); }
.st-results__chips { display: flex; flex: 1; gap: var(--st-space-2); min-width: 0; overflow-x: auto; scrollbar-width: none; }
.st-results__chips::-webkit-scrollbar { display: none; }
.st-results__chips .st-chip { flex: none; }
.st-results__chips .st-chip[aria-pressed="true"] { background: var(--st-accent); border-color: var(--st-accent); color: #fff; }
.st-results__filters-btn { position: relative; flex: none; }
.st-results__filters-btn[aria-expanded="true"] { background: var(--st-surface-3); color: var(--st-text); }

/* Filters: one column per group, like YouTube's filter sheet */
.st-results__filters { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--st-space-4) var(--st-space-6); margin: 0 0 var(--st-space-4); padding: var(--st-space-4) var(--st-space-5); border: 1px solid var(--st-line); border-radius: var(--st-radius-lg); background: var(--st-surface-1); animation: st-rise var(--st-base) var(--st-ease); }
.st-results__filters[hidden] { display: none; }
.st-results__fgroup h2 { margin: 0 0 4px; padding-bottom: 8px; border-bottom: 1px solid var(--st-line); color: var(--st-text-2); font: 700 var(--st-text-xs)/1.2 var(--st-font); letter-spacing: .06em; text-transform: uppercase; }
.st-results__fgroup button { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; min-height: 32px; padding: 4px 0; border: 0; background: none; color: var(--st-text-2); font: 500 var(--st-text-sm)/1.3 var(--st-font); text-align: left; cursor: pointer; }
.st-results__fgroup button:hover { color: var(--st-text); }
.st-results__fgroup button[aria-pressed="true"] { color: var(--st-accent-text); font-weight: 700; }
.st-results__fgroup button[aria-pressed="true"]::after { content: ""; width: 7px; height: 7px; flex: none; border-radius: 50%; background: var(--st-accent); }
.st-results__fgroup button:disabled { opacity: .4; cursor: not-allowed; }
.st-results__fclear { grid-column: 1 / -1; justify-self: end; }
.st-results__fclear[hidden] { display: none; }

/* Which archive is searched: the 18+ opt-in, same orange box as the home page */
.st-results__scope { display: flex; align-items: center; gap: 8px 14px; margin: 0 0 var(--st-space-5); padding: 4px 6px 4px 12px; border: 1px solid #8b4b20; border-left: 4px solid #ff9500; border-radius: var(--st-radius-lg); background: #1b110b; }
.st-results__scope img { width: 28px; height: 28px; flex: none; border: 1px solid #ff9500; border-radius: 50%; object-fit: cover; object-position: center top; }
.st-results__scope-text { flex: 1; min-width: 0; font-size: var(--st-text-sm); }
.st-results__scope-text strong { font-weight: 600; color: #f1dfd0; }
body.sc-show-community .st-results__scope { border-color: var(--st-line); border-left-color: var(--st-accent); background: var(--st-surface-1); }
body.sc-show-community .st-results__scope img { border-color: var(--st-accent); }
body.sc-show-community .st-results__scope-off, body:not(.sc-show-community) .st-results__scope-on { display: none; }
.st-results__scope .st-choice__toggle { min-height: 36px; padding: 0 6px; white-space: nowrap; }

/* Rows: thumbnail left, text right */
.st-results__list, .st-results__channels { display: grid; gap: var(--st-space-4); }
.st-results__channels { margin-bottom: var(--st-space-4); padding-bottom: var(--st-space-4); border-bottom: 1px solid var(--st-line); }
.st-results__channels[hidden] { display: none; }
.st-result { display: grid; grid-template-columns: minmax(240px, 360px) minmax(0, 1fr); align-items: start; gap: var(--st-space-4); min-width: 0; }
.st-result__body { position: relative; display: grid; grid-template-columns: 24px minmax(0, 1fr); grid-template-areas: "title title" "meta meta" "av chan" "desc desc" "tags tags"; align-items: center; column-gap: 8px; min-width: 0; padding-right: 40px; }
.st-result__title { grid-area: title; display: -webkit-box; overflow: hidden; margin: 0; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: anywhere; font: 500 var(--st-text-xl)/1.35 var(--st-font); }
.st-result__meta { grid-area: meta; margin: 4px 0 0; color: var(--st-text-3); font-size: var(--st-text-xs); }
.st-result__av { grid-area: av; margin: 12px 0; }
.st-result__av .st-avatar { display: block; width: 24px; height: 24px; }
.st-result__chan { grid-area: chan; display: inline-flex; align-items: center; justify-self: start; max-width: 100%; margin: 12px 0; color: var(--st-text-2); font-size: var(--st-text-xs); }
.st-result__chan:hover { color: var(--st-text); }
.st-result__desc { grid-area: desc; display: -webkit-box; overflow: hidden; margin: 0; -webkit-line-clamp: 2; -webkit-box-orient: vertical; color: var(--st-text-3); font-size: var(--st-text-xs); line-height: 1.5; }
.st-result__desc b { color: var(--st-text-2); font-weight: 700; }
.st-result__tags { grid-area: tags; display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.st-result__more { position: absolute; top: -4px; right: 0; }
.st-result__menu { top: 34px; right: 0; min-width: 232px; }
.st-result__short { display: inline-flex; align-items: center; gap: 3px; }
.st-result__short .st-ico { width: 12px; height: 12px; }
@media (hover: hover) {
  .st-result__more [data-rs-menu] { opacity: 0; transition: opacity var(--st-fast) var(--st-ease); }
  .st-result:hover [data-rs-menu], .st-result:focus-within [data-rs-menu], [data-rs-menu][aria-expanded="true"] { opacity: 1; }
  .st-result:hover .st-thumb img { transform: scale(1.03); }
}
.st-result--channel .st-result__pfp { display: grid; place-items: center; padding: 6px 0; }
.st-result--channel .st-result__pfp .st-avatar { width: 112px; height: 112px; border: 2px solid var(--st-line-strong); transition: border-color var(--st-fast) var(--st-ease); }
.st-result--channel:hover .st-result__pfp .st-avatar { border-color: var(--st-accent); }
.st-result--channel .st-result__body { grid-template-columns: minmax(0, 1fr); grid-template-areas: "title" "meta" "go"; align-self: center; padding-right: 0; }
.st-result--channel .st-result__title { display: flex; align-items: center; }
.st-result--channel .st-result__go { grid-area: go; justify-self: start; margin-top: 12px; }
.st-result--skel .st-result__body { display: block; padding-top: 2px; }
.st-result--skel .st-skel--line:first-child { width: 82%; height: 18px; margin-top: 0; }

/* End of the list, empty and error states */
.st-results__end { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: var(--st-space-3); margin: var(--st-space-8) 0 var(--st-space-4); color: var(--st-text-3); font-size: var(--st-text-sm); text-align: center; }
.st-results__empty img { width: 96px; height: 112px; margin-bottom: var(--st-space-2); border: 2px solid var(--st-accent); border-radius: 12px; object-fit: cover; object-position: center top; }
.st-results__empty span { max-width: 460px; line-height: 1.5; }
.st-results__empty > .st-btn { margin-top: var(--st-space-2); }
.st-results__empty .st-btn .st-ico { width: 16px; height: 16px; stroke-width: 2; }
.st-results__empty-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--st-space-2); margin-top: var(--st-space-3); }
#rs-sentinel { height: 1px; }

@media (max-width: 1100px) {
  .st-results__filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 768px) {
  .st-results__bar { padding: var(--st-space-2) 0; }
  .st-results__filters-btn { width: 36px; padding: 0; justify-content: center; }
  .st-results__filters-btn > span { display: none; }
  .st-results__filters-btn .st-filter-count { position: absolute; top: -4px; right: -4px; }
  .st-results__filters { padding: var(--st-space-3) var(--st-space-4); }
  .st-results__scope { flex-wrap: wrap; padding: 8px 10px; }
  .st-results__scope .st-choice__toggle { width: 100%; padding: 6px 0 0; border-top: 1px solid #63412d; }
  body.sc-show-community .st-results__scope .st-choice__toggle { border-top-color: var(--st-line); }
  .st-results__list { gap: var(--st-space-6); }
  .st-result { grid-template-columns: minmax(0, 1fr); gap: var(--st-space-3); }
  .st-result__body { grid-template-columns: 36px minmax(0, 1fr); grid-template-areas: "av title" "av chan" "av meta" "av tags"; align-items: start; column-gap: 12px; padding-right: 32px; }
  .st-result__av { margin: 0; }
  .st-result__av .st-avatar { width: 36px; height: 36px; }
  .st-result__title { font-size: var(--st-text-md); }
  .st-result__chan { margin: 4px 0 0; }
  .st-result__meta { margin: 0; }
  .st-result__desc { display: none; }
  .st-result__more { top: -6px; right: -8px; }
  .st-result--channel { grid-template-columns: 72px minmax(0, 1fr); align-items: center; }
  .st-result--channel .st-result__pfp { padding: 0; }
  .st-result--channel .st-result__pfp .st-avatar { width: 72px; height: 72px; }
  .st-result--channel .st-result__body { grid-template-areas: "title" "meta" "go"; padding-right: 0; }
  .st-result--channel .st-result__go { margin-top: 8px; }
  .st-result--skel .st-result__body { padding-left: 48px; }
}

/* ══ Channel page (channel.php) ══════════════════════════════ */
.st-chan { width: 100%; max-width: 1600px; margin: 0 auto; padding-top: var(--st-space-8); }
.st-chan__head { display: flex; align-items: center; gap: var(--st-space-6); padding-bottom: var(--st-space-6); }
.st-chan__pfp { width: 112px; height: 112px; flex: none; border-radius: 50%; object-fit: cover; background: var(--st-surface-3); }
.st-chan__info { display: grid; gap: var(--st-space-2); min-width: 0; }
.st-chan__name { display: flex; align-items: center; gap: 4px; min-width: 0; margin: 0; font: 700 var(--st-text-3xl)/1.15 var(--st-font); letter-spacing: -.01em; overflow-wrap: anywhere; }
.st-chan__name .st-verified { width: 20px; height: 20px; margin-left: 6px; vertical-align: 0; }
.st-chan__stats { display: flex; flex-wrap: wrap; gap: 2px 0; margin: 0; color: var(--st-text-3); font-size: var(--st-text-sm); }
.st-chan__stats > span + span::before { content: "·"; margin: 0 8px; }
.st-chan__stats strong { color: var(--st-text-2); font-weight: 600; font-variant-numeric: tabular-nums; }
.st-chan__actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--st-space-2); margin-top: var(--st-space-2); }
.st-chan__actions .st-btn { border-radius: var(--st-radius-pill); }
.st-chan__bell { border: 1px solid var(--st-line-strong); }

.st-chan__uploads { margin: 0 0 var(--st-space-6); padding: var(--st-space-4) var(--st-space-5); border: 1px solid var(--st-line); border-radius: var(--st-radius-lg); background: var(--st-surface-1); }
.st-chan__uploads .st-section-head { margin-bottom: var(--st-space-3); }
.st-chan__uploads .st-section-head h2 { font-size: var(--st-text-lg); }
.st-upstat { display: grid; margin: 0; padding: 0; list-style: none; }
.st-upstat__item { display: flex; gap: var(--st-space-3); padding: var(--st-space-3) 0; border-top: 1px solid var(--st-line); }
.st-upstat__item:first-child { border-top: 0; padding-top: 0; }
.st-upstat__ico { display: grid; place-items: center; width: 32px; height: 32px; flex: none; border-radius: 50%; background: var(--st-surface-3); }
.st-upstat__ico .st-ico { width: 16px; height: 16px; }
.st-upstat__ico--info { background: var(--st-info-tint); color: var(--st-info); }
.st-upstat__ico--warning { background: var(--st-warning-tint); color: var(--st-warning); }
.st-upstat__ico--danger { background: var(--st-danger-tint); color: var(--st-danger); }
.st-upstat__ico--success { background: var(--st-success-tint); color: var(--st-success); }
.st-upstat__text { min-width: 0; }
.st-upstat__top { display: flex; flex-wrap: wrap; align-items: center; gap: 4px var(--st-space-2); }
.st-upstat__top strong { min-width: 0; overflow-wrap: anywhere; font-weight: 600; }
.st-upstat__top a:hover { color: var(--st-accent-text); }
.st-upstat__text p { margin: 2px 0 0; color: var(--st-text-3); font-size: var(--st-text-sm); line-height: 1.45; }
.st-upstat__reasons { display: flex; flex-wrap: wrap; gap: 4px; margin: 6px 0 0; padding: 0; list-style: none; }
.st-upstat__reasons li { padding: 2px 8px; border-radius: var(--st-radius-pill); background: var(--st-surface-3); color: var(--st-text-2); font-size: var(--st-text-xs); }
.st-upstat__item.is-extra { display: none; }
.st-upstat.is-open .st-upstat__item.is-extra { display: flex; }
.st-upstat__more { margin-top: var(--st-space-2); }

.st-chan__bar { position: sticky; top: var(--st-header-h); z-index: 5; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--st-space-3); margin-bottom: var(--st-space-6); border-bottom: 1px solid var(--st-line); background: var(--st-bg); }
.st-chan__bar .st-tabs { border-bottom: 0; }
.st-chan__bar .st-tab:first-child { padding-left: 0; }
.st-chan__bar .st-tab:first-child::after { left: 0; }
.st-chan__sort { display: flex; gap: var(--st-space-2); padding: 6px 0; }
.st-chan__sort .st-chip[aria-pressed="true"] { border-color: var(--st-text); background: var(--st-text); color: var(--st-bg); }

.st-vcard--bare .st-vcard__body { grid-template-columns: minmax(0, 1fr); }
.st-vcard__owner { display: flex; gap: 4px; margin: 8px 0 0 -8px; }
.st-vcard__owner .st-vcard__delete:hover { background: var(--st-danger-tint); color: var(--st-danger); }
.st-chan__shorts { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: var(--st-space-6) var(--st-space-3); }
.st-chan__short .st-vcard__owner { margin: 4px 0 0 -6px; }
.st-chan__short .st-scard:hover .st-scard__thumb img { transform: scale(1.03); }

dialog.st-dialog { position: fixed; padding: 0; color: var(--st-text); }
dialog.st-dialog::backdrop { background: rgba(5, 4, 6, .72); }
.st-dialog--sm { width: min(440px, calc(100% - 32px)); }
.st-chan__thumbpick { display: flex; align-items: center; gap: var(--st-space-4); }
.st-chan__thumbpick img { width: 160px; height: 90px; flex: none; border-radius: var(--st-radius); object-fit: cover; background: var(--st-surface-3); }
.st-chan__thumbpick label { cursor: pointer; }
.st-chan__thumbpick label:has(+ input:focus-visible) { box-shadow: var(--st-focus); }
.st-chan__hint { margin: 6px 0 0; color: var(--st-text-3); font-size: var(--st-text-xs); }
.st-dialog__text { margin: 0; color: var(--st-text-2); line-height: 1.5; }
.st-dialog__text strong { color: var(--st-text); }
.st-chan__error { margin: var(--st-space-3) 0 0; color: var(--st-danger); font-size: var(--st-text-sm); }
.st-chan__dialog .st-btn .st-spinner { width: 14px; height: 14px; border-top-color: currentColor; }

@media (max-width: 768px) {
  .st-chan { padding-top: var(--st-space-5); }
  .st-chan__head { flex-direction: column; align-items: flex-start; gap: var(--st-space-4); padding-bottom: var(--st-space-4); }
  .st-chan__pfp { width: 80px; height: 80px; }
  .st-chan__name { font-size: var(--st-text-2xl); }
  .st-chan__actions { margin-top: var(--st-space-1); }
  .st-chan__bar { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; gap: var(--st-space-4); margin-bottom: var(--st-space-4); }
  .st-chan__bar::-webkit-scrollbar { display: none; }
  .st-chan__bar > * { flex: none; }
  .st-chan__shorts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .st-chan__uploads { padding: var(--st-space-3) var(--st-space-4); }
}
@media (max-width: 480px) {
  .st-chan__thumbpick { flex-direction: column; align-items: flex-start; }
}

/* ══ Shorts page (shorts.php) ════════════════════════════════ */
.st-shorts-page { height: 100dvh; overflow: hidden; overscroll-behavior: none; }
.st-shorts-page .st-main { position: relative; padding: 0; min-height: 0; }
.st-shorts__feed { height: calc(100dvh - var(--st-header-h)); overflow-y: auto; overscroll-behavior: contain; scroll-snap-type: y mandatory; overflow-anchor: none; scrollbar-width: none; touch-action: pan-y; }
.st-shorts__feed::-webkit-scrollbar { display: none; }
.st-short { position: relative; display: flex; align-items: flex-end; justify-content: center; gap: var(--st-space-4); height: 100%; padding: var(--st-space-4) 0; scroll-snap-align: start; scroll-snap-stop: always; }
.st-short__stage { position: relative; height: 100%; aspect-ratio: 9 / 16; max-width: calc(100vw - 32px); overflow: hidden; border-radius: var(--st-radius-lg); background: #000; cursor: pointer; }
.st-short__bg { position: absolute; inset: -20px; background-size: cover; background-position: center; filter: blur(24px) brightness(.5); }
.st-short__video { position: relative; display: block; width: 100%; height: 100%; object-fit: contain; background: transparent; }
.st-short__stage::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 45%; background: linear-gradient(to top, rgba(0, 0, 0, .78), transparent); pointer-events: none; }
.st-short__state { position: absolute; top: 50%; left: 50%; z-index: 2; display: grid; place-items: center; width: 72px; height: 72px; border-radius: 50%; background: rgba(0, 0, 0, .55); color: #fff; opacity: 0; transform: translate(-50%, -50%) scale(.9); transition: opacity var(--st-fast) var(--st-ease), transform var(--st-fast) var(--st-ease); pointer-events: none; }
.st-short__state .st-ico { width: 32px; height: 32px; margin-left: 4px; }
.st-short.is-paused .st-short__state { opacity: 1; transform: translate(-50%, -50%); }
.st-short__mute { position: absolute; top: 12px; right: 12px; z-index: 3; display: grid; place-items: center; width: 40px; height: 40px; border: 0; border-radius: 50%; background: rgba(0, 0, 0, .5); color: #fff; cursor: pointer; }
.st-short__mute:hover { background: rgba(0, 0, 0, .72); }
.st-short__info { position: absolute; left: 16px; right: 16px; bottom: 16px; z-index: 3; display: grid; gap: 6px; color: #fff; cursor: default; }
.st-short__author { display: inline-flex; align-items: center; gap: 8px; justify-self: start; max-width: 100%; font: 600 var(--st-text-md)/1.2 var(--st-font); }
.st-short__author span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
a.st-short__author:hover span { text-decoration: underline; }
.st-short__title { display: -webkit-box; overflow: hidden; margin: 0; font-size: var(--st-text-md); line-height: 1.4; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: anywhere; }
.st-short__meta { margin: 0; color: rgba(255, 255, 255, .7); font-size: var(--st-text-xs); }
.st-short__actions { display: flex; flex-direction: column; align-items: center; gap: var(--st-space-4); padding-bottom: var(--st-space-2); }
.st-short__act { display: flex; flex-direction: column; align-items: center; gap: 6px; border: 0; background: none; color: var(--st-text); font: 600 var(--st-text-xs)/1 var(--st-font); cursor: pointer; }
.st-short__ico { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; background: var(--st-surface-3); transition: background var(--st-fast) var(--st-ease), transform var(--st-fast) var(--st-ease); }
.st-short__act:hover .st-short__ico { background: var(--st-surface-hover); }
.st-short__act:active .st-short__ico { transform: scale(.92); }
.st-short__act.liked .st-short__ico { background: var(--st-text); color: var(--st-bg); }
.st-short__act.liked .st-ico { fill: currentColor; }
.st-shorts__nav { position: absolute; right: var(--st-space-6); top: 50%; display: grid; gap: var(--st-space-3); transform: translateY(-50%); }
.st-shorts__nav .st-icon-btn { width: 48px; height: 48px; background: var(--st-surface-3); color: var(--st-text); }
.st-shorts__nav .st-icon-btn:hover { background: var(--st-surface-hover); }
.st-ico--flip { transform: rotate(180deg); }
.st-shorts__hint { position: absolute; left: 50%; bottom: 28px; z-index: 4; display: none; align-items: center; gap: 6px; padding: 6px 12px; border-radius: var(--st-radius-pill); background: rgba(0, 0, 0, .6); color: #fff; font-size: var(--st-text-xs); transform: translateX(-50%); transition: opacity var(--st-base) var(--st-ease); pointer-events: none; }
.st-shorts__empty { height: 100%; align-content: center; }

@media (max-width: 768px) {
  .st-shorts-page.st-shell { padding-bottom: 0; }
  .st-shorts__feed { height: calc(100dvh - var(--st-header-h) - 56px - env(safe-area-inset-bottom, 0px)); }
  .st-short { padding: 0; }
  .st-short__stage { width: 100%; max-width: none; aspect-ratio: auto; border-radius: 0; }
  .st-short__info { right: 76px; bottom: 20px; }
  .st-short__actions { position: absolute; right: 8px; bottom: 20px; z-index: 3; padding: 0; }
  .st-short__act { color: #fff; text-shadow: 0 1px 3px rgba(0, 0, 0, .8); }
  .st-short__ico { width: 44px; height: 44px; background: rgba(0, 0, 0, .45); }
  .st-short__act.liked .st-short__ico { background: #fff; color: #000; }
  .st-shorts__nav { display: none; }
  .st-shorts__hint { display: inline-flex; bottom: 96px; }
}
@media (prefers-reduced-motion: reduce) { .st-shorts__hint { animation: none; } }

/* ══ Messages page (messages.php) ════════════════════════════ */
.st-msg-page { height: 100dvh; overflow: hidden; }
.st-msg-page .st-main.st-msg {
  display: grid; grid-template-columns: minmax(260px, 340px) minmax(0, 1fr);
  height: calc(100dvh - var(--st-header-h)); min-height: 0; padding: 0; border-left: 1px solid var(--st-line);
}
.st-msg__list { display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--st-line); }
.st-msg__title { margin: 0; padding: var(--st-space-5) var(--st-space-5) var(--st-space-3); font: 700 var(--st-text-xl)/1.2 var(--st-font); }
.st-msg__convs, .st-msg__log { overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: var(--st-surface-3) transparent; }
.st-msg__convs { flex: 1; min-height: 0; padding: 0 var(--st-space-2) var(--st-space-4); }
.st-msg__items { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px; margin: 0; padding: 0; list-style: none; }
.st-msg__conv {
  display: flex; align-items: center; gap: var(--st-space-3); width: 100%; padding: 10px var(--st-space-3);
  border: 0; border-radius: var(--st-radius); background: none; color: var(--st-text); font: inherit; text-align: left; cursor: pointer;
  transition: background var(--st-fast) var(--st-ease);
}
.st-msg__conv:hover { background: var(--st-surface-2); }
.st-msg__conv.is-active { background: var(--st-surface-3); }
.st-msg__conv:focus-visible { outline: none; box-shadow: var(--st-focus); }
.st-msg__conv-main { display: grid; flex: 1; grid-template-columns: minmax(0, 1fr); gap: 3px; min-width: 0; }
.st-msg__conv-top { display: flex; align-items: baseline; gap: var(--st-space-2); }
.st-msg__conv-top strong { flex: 1; min-width: 0; overflow: hidden; font-size: var(--st-text-md); font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.st-msg__conv-top time { flex: none; color: var(--st-text-3); font-size: var(--st-text-xs); }
.st-msg__conv-preview { display: flex; align-items: center; gap: 5px; min-width: 0; color: var(--st-text-3); font-size: var(--st-text-sm); }
.st-msg__conv-preview > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-msg__conv-preview.is-muted { font-style: italic; }
.st-msg__conv.is-unread .st-msg__conv-top strong { font-weight: 700; }
.st-msg__conv.is-unread .st-msg__conv-preview { color: var(--st-text); }
.st-msg__conv.is-unread time { color: var(--st-accent-text); }
.st-msg__note { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: var(--st-space-3); margin: 0; padding: var(--st-space-8) var(--st-space-4); color: var(--st-text-3); font-size: var(--st-text-sm); text-align: center; }
.st-msg__note .st-spinner { width: 16px; height: 16px; }
.st-msg__note--error { flex-direction: column; color: var(--st-text-2); }
.st-msg__none span, .st-msg__empty span { max-width: 280px; font-size: var(--st-text-sm); line-height: 1.5; }

.st-msg__thread { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.st-msg__empty { flex: 1; align-content: center; }
.st-msg__chat { display: flex; flex: 1; flex-direction: column; min-height: 0; }
.st-msg__chat[hidden], .st-msg__empty[hidden], .st-msg__attach[hidden] { display: none; }
.st-msg__head { display: flex; align-items: center; gap: var(--st-space-3); min-height: 64px; padding: var(--st-space-2) var(--st-space-5); border-bottom: 1px solid var(--st-line); }
.st-msg__back { display: none; margin-left: -6px; }
.st-msg__who { display: flex; align-items: center; gap: var(--st-space-3); min-width: 0; color: var(--st-text); }
.st-msg__who > span { display: grid; min-width: 0; }
.st-msg__who strong { overflow: hidden; font-size: var(--st-text-md); text-overflow: ellipsis; white-space: nowrap; }
.st-msg__who small { color: var(--st-text-3); font-size: var(--st-text-xs); }
.st-msg__who:hover small { color: var(--st-text-2); text-decoration: underline; }
.st-msg__tools { display: flex; flex: none; gap: var(--st-space-1); margin-left: auto; }

.st-msg__log { display: flex; flex: 1; flex-direction: column; gap: 6px; min-height: 0; padding: var(--st-space-5) var(--st-space-5) var(--st-space-4); }
.st-msg__log > :first-child { margin-top: auto; }
.st-msg__day { align-self: center; margin: var(--st-space-3) 0 var(--st-space-1); padding: 3px 10px; border-radius: var(--st-radius-pill); background: var(--st-surface-2); color: var(--st-text-3); font: 600 var(--st-text-xs)/1.4 var(--st-font); }
.st-msg__start { display: flex; flex-direction: column; align-items: center; gap: var(--st-space-2); margin: 0; padding: var(--st-space-6) var(--st-space-4); color: var(--st-text-3); font-size: var(--st-text-sm); text-align: center; }
.st-msg__start strong { color: var(--st-text); }

.st-bubble { display: grid; gap: 3px; max-width: min(72%, 560px); }
.st-bubble--mine { align-self: flex-end; justify-items: end; }
.st-bubble--theirs { align-self: flex-start; justify-items: start; }
.st-bubble__text {
  padding: 8px 12px; border: 1px solid var(--st-line); border-radius: 16px; background: var(--st-surface-2);
  font-size: var(--st-text-md); line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere;
}
.st-bubble--mine .st-bubble__text { border-color: rgba(255, 36, 184, .3); border-bottom-right-radius: 4px; background: rgba(255, 36, 184, .15); }
.st-bubble--theirs .st-bubble__text { border-bottom-left-radius: 4px; }
.st-bubble.is-deleted .st-bubble__text { border-style: dashed; border-color: var(--st-line-strong); background: none; color: var(--st-text-3); font-size: var(--st-text-sm); font-style: italic; }
.st-bubble__img { display: block; overflow: hidden; border: 1px solid var(--st-line); border-radius: 14px; background: var(--st-surface-2); }
.st-bubble__img img { display: block; width: auto; max-width: min(260px, 64vw); height: auto; max-height: 320px; object-fit: cover; }
.st-bubble__meta { display: flex; align-items: center; gap: 6px; min-height: 24px; color: var(--st-text-3); font-size: 11px; }
.st-bubble__edited::before { content: "·"; margin-right: 6px; }
.st-bubble__act {
  display: inline-grid; place-items: center; width: 26px; height: 26px; border: 0; border-radius: 50%;
  background: none; color: var(--st-text-3); cursor: pointer; opacity: 0;
  transition: opacity var(--st-fast) var(--st-ease), background var(--st-fast) var(--st-ease), color var(--st-fast) var(--st-ease);
}
.st-bubble:hover .st-bubble__act, .st-bubble:focus-within .st-bubble__act { opacity: 1; }
.st-bubble__act:hover { background: var(--st-surface-3); color: var(--st-text); }
.st-bubble__act[data-delete]:hover { color: var(--st-danger); }
.st-bubble__act:focus-visible { outline: none; box-shadow: var(--st-focus); }
.st-bubble.is-editing { max-width: 100%; }
.st-bubble.is-editing .st-bubble__meta { display: none; }
.st-bubble__edit { display: grid; gap: var(--st-space-2); width: min(440px, 80vw); }
.st-bubble__edit .st-textarea { min-height: 72px; }
.st-bubble__edit-actions { display: flex; justify-content: flex-end; gap: var(--st-space-2); }
@media (hover: none) { .st-bubble__act { opacity: 1; } }

.st-msg__attach { display: flex; align-items: center; gap: var(--st-space-3); padding: var(--st-space-2) var(--st-space-5); border-top: 1px solid var(--st-line); color: var(--st-text-2); font-size: var(--st-text-sm); }
.st-msg__attach img { width: 48px; height: 48px; border-radius: var(--st-radius); object-fit: cover; background: var(--st-surface-3); }
.st-msg__attach span { flex: 1; }
.st-msg__composer { display: flex; align-items: flex-end; gap: var(--st-space-2); padding: var(--st-space-3) var(--st-space-5) var(--st-space-4); border-top: 1px solid var(--st-line); }
.st-msg__composer .st-icon-btn { flex: none; width: 40px; height: 40px; }
.st-msg__input.st-textarea { flex: 1; height: 40px; min-height: 40px; max-height: 144px; resize: none; }
.st-msg__send { flex: none; min-height: 40px; }
.st-msg__send[aria-busy="true"] { opacity: .65; cursor: progress; }

@media (max-width: 1100px) {
  .st-msg-page .st-main.st-msg { border-left: 0; }
}
@media (max-width: 768px) {
  .st-msg-page.st-shell { padding-bottom: 0; }
  .st-msg-page .st-main.st-msg { grid-template-columns: minmax(0, 1fr); height: calc(100dvh - var(--st-header-h) - 56px - env(safe-area-inset-bottom, 0px)); }
  .st-msg__list { border-right: 0; }
  .st-msg.is-open .st-msg__list, .st-msg:not(.is-open) .st-msg__thread { display: none; }
  .st-msg__title { padding: var(--st-space-4) var(--st-space-4) var(--st-space-2); }
  .st-msg__back { display: inline-grid; }
  .st-msg__head { min-height: 56px; padding: var(--st-space-2) var(--st-space-3); gap: var(--st-space-2); }
  /* Icon-only buttons; the label stays for screen readers. */
  .st-msg__tools .st-btn span, .st-msg__send span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .st-msg__tools .st-btn { padding: 0 8px; }
  .st-msg__send { padding: 0 12px; }
  .st-msg__log { padding: var(--st-space-4) var(--st-space-3) var(--st-space-3); }
  .st-bubble { max-width: 85%; }
  .st-msg__attach { padding: var(--st-space-2) var(--st-space-3); }
  .st-msg__composer { padding: var(--st-space-2) var(--st-space-3); }
}
