/* HorseTube - single stylesheet. Dark by default, light via [data-theme=light].
 * Type scale floor is 14px everywhere except --fs-micro labels (badges, durations, counts),
 * which stay at 12px; body copy is 15px. Every interactive control clears 44x44, and hover-only
 * overlay controls are dropped on touch layouts where hover does not exist. */

:root {
  --bg: #0f0f0f;
  --surface: #181818;
  --surface-2: #212121;
  --surface-3: #2f2f2f;
  --line: #303030;
  --fg: #f1f1f1;
  --muted: #aaaaaa;
  --accent: #e8843c;
  --accent-ink: #1a1005;
  --danger: #f4483a;
  --ok: #35b46f;
  --radius: 12px;
  --topbar-h: 56px;
  --rail-w: 232px;
  --shadow: 0 6px 24px rgba(0, 0, 0, .45);
  --fs-micro: 12px;
  --overlay: rgba(0, 0, 0, .62);
}

[data-theme="light"] {
  --bg: #ffffff;
  --surface: #f5f5f5;
  --surface-2: #ebebeb;
  --surface-3: #dedede;
  --line: #d8d8d8;
  --fg: #0c0c0c;
  --muted: #4d4d4d;
  --accent: #a34c17;
  --accent-ink: #fff7ef;
  --shadow: 0 4px 18px rgba(0, 0, 0, .14);
}

* { box-sizing: border-box; }

html, body { margin: 0; height: 100%; }

body {
  background: var(--bg);
  color: var(--fg);
  font: 14px/1.5 "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
  overscroll-behavior-y: none;
  scrollbar-color: var(--surface-3) var(--bg);
  scrollbar-width: thin;
}

a { color: inherit; text-decoration: none; text-underline-offset: 3px; }
button { font: inherit; color: inherit; }
svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
[hidden] { display: none !important; }

::selection { background: var(--accent); color: var(--accent-ink); }
input, textarea { caret-color: var(--accent); }
::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 6px; border: 3px solid var(--bg); }
::-webkit-scrollbar-track { background: var(--bg); }

.skip {
  position: fixed; left: -999px; top: 8px; z-index: 99;
  display: inline-flex; align-items: center; min-height: 44px;
  background: var(--accent); color: var(--accent-ink); padding: 0 16px; border-radius: 10px; font-weight: 700;
}
.skip:focus { left: 8px; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ------------------------------------------------------------------ topbar */
.topbar {
  position: fixed; inset: 0 0 auto 0; height: var(--topbar-h); z-index: 30;
  display: flex; align-items: center; gap: 12px; padding: 0 14px;
  background: var(--bg);
}

.topbar-left { display: flex; align-items: center; gap: 8px; min-width: 170px; }
.topbar-right { display: flex; align-items: center; gap: 10px; margin-left: auto; }

.icon-btn {
  width: 44px; height: 44px; flex: none; border: 0; border-radius: 50%;
  background: transparent; display: grid; place-items: center; cursor: pointer;
}
.icon-btn:hover { background: var(--surface-2); }
.icon-btn svg { width: 22px; height: 22px; }

.logo { display: flex; align-items: center; gap: 8px; min-height: 44px; min-width: 44px; padding: 0 6px; }
.logo-mark { width: 30px; height: 30px; display: grid; place-items: center; background: var(--accent); border-radius: 8px; }
.logo-mark svg { width: 22px; height: 22px; stroke: none; fill: var(--accent-ink); }
.logo-word { font-size: 19px; letter-spacing: -.4px; font-weight: 400; }
.logo-word b { font-weight: 800; color: var(--accent); }

.search { display: flex; flex: 1 1 640px; max-width: 640px; min-width: 0; margin-left: 24px; }
.search input {
  flex: 1; min-width: 0; height: 44px; padding: 0 14px;
  background: var(--surface); border: 1px solid var(--line); color: var(--fg);
  border-radius: 22px 0 0 22px; font-size: 16px;
}
.search input::placeholder { color: var(--muted); }
.search input:focus { outline: none; border-color: var(--accent); }
.search-btn {
  width: 56px; height: 44px; flex: none; border: 1px solid var(--line); border-left: 0;
  background: var(--surface-2);
  border-radius: 0 22px 22px 0; cursor: pointer; display: grid; place-items: center;
}
.search-btn:hover { background: var(--surface-3); }
.search-btn svg { width: 20px; height: 20px; }

.pill-btn {
  display: flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 16px;
  border: 0; border-radius: 22px; background: var(--surface-2); cursor: pointer; font-weight: 600;
}
.pill-btn:hover { background: var(--surface-3); }
.pill-btn svg { width: 18px; height: 18px; }

.me {
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  background: var(--accent); color: var(--accent-ink); font-weight: 700; font-size: 14px; text-transform: uppercase;
}
a.me { text-decoration: none; }
a.me:hover { outline: 2px solid var(--accent); outline-offset: 2px; }
.pill-btn.solid { background: var(--accent); color: var(--accent-ink); }
.pill-btn.solid:hover { background: var(--surface-3); color: var(--fg); }

#authDialog {
  width: min(460px, calc(100vw - 32px)); padding: 18px 20px 22px; border-radius: 16px;
  border: 1px solid var(--line); background: var(--surface); color: var(--fg);
}
#authDialog::backdrop { background: rgba(0, 0, 0, .62); }
.auth-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.auth-head h2 { margin: 0; font-size: 20px; }
.auth-note { color: var(--muted); font-size: 14px; line-height: 1.45; }
#authForms form { display: flex; flex-direction: column; gap: 6px; }
#authForms label { font-size: 14px; font-weight: 600; margin-top: 8px; }
#authForms input {
  min-height: 44px; padding: 0 12px; font-size: 16px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--bg); color: var(--fg);
}
#authForms input:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
#authForms button { align-self: flex-start; margin-top: 12px; }
#authForms hr { border: 0; border-top: 1px solid var(--line); margin: 18px 0 2px; }
.auth-error { color: var(--fg); font-size: 14px; font-weight: 600; margin: 6px 0 0; }
.auth-code { margin: 10px 0 14px; }
.auth-code code {
  display: block; padding: 12px; border-radius: 10px; background: var(--surface-2);
  font-size: 16px; font-weight: 700; letter-spacing: .04em; word-break: break-all;
}
.auth-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.account-stats { display: flex; flex-wrap: wrap; gap: 10px; margin: 18px 0; padding: 0; list-style: none; }
.account-stats li { border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; background: var(--surface); }
.account-stats b { display: block; font-size: 20px; }
.account-stats span { color: var(--muted); font-size: 14px; }
.account-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.account-card { max-width: 62ch; }

/* ---------------------------------------------------------------- sidebar */
.sidebar {
  position: fixed; top: var(--topbar-h); bottom: 0; left: 0; width: var(--rail-w); z-index: 20;
  padding: 8px 8px 32px; overflow-y: auto; background: var(--bg);
}
.sidebar hr { border: 0; border-top: 1px solid var(--line); margin: 10px 6px; }
.rail-group { display: flex; flex-direction: column; gap: 2px; }
.rail-item {
  display: flex; align-items: center; gap: 14px; min-height: 44px; padding: 0 12px;
  border-radius: 10px; color: var(--fg);
}
.rail-item svg { width: 22px; height: 22px; flex: none; }
.rail-item span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rail-item:hover { background: var(--surface-2); }
.rail-item.active { background: var(--surface-3); font-weight: 700; }
.rail-badge {
  margin-left: auto; font-style: normal; font-size: var(--fs-micro); background: var(--accent);
  color: var(--accent-ink); border-radius: 9px; padding: 1px 7px; font-weight: 700;
}
.rail-heading { font-size: 14px; color: var(--muted); margin: 16px 12px 6px; font-weight: 700; }
.rail-about { padding: 0 12px; color: var(--muted); font-size: 14px; }
.rail-about p { margin: 0 0 8px; }
.rail-stats code { color: var(--fg); font-size: 14px; }

.channels .rail-item img { width: 24px; height: 24px; border-radius: 50%; flex: none; }

body.rail-mini .sidebar { width: 84px; }
body.rail-mini .rail-item { flex-direction: column; gap: 4px; height: 74px; padding: 10px 4px 0; font-size: var(--fs-micro); text-align: center; line-height: 1.25; }
body.rail-mini .rail-item span { max-width: 76px; white-space: normal; overflow: visible; }
body.rail-mini .rail-badge { position: absolute; margin: 0; transform: translate(22px, -18px); }
body.rail-mini .rail-heading, body.rail-mini .rail-about, body.rail-mini .sidebar hr { display: none; }
body.rail-mini .channels .rail-item { height: 46px; flex-direction: row; }
body.rail-mini .channels .rail-item span { display: none; }

/* ------------------------------------------------------------------ layout */
#page {
  margin: var(--topbar-h) 0 0 var(--rail-w);
  min-height: calc(100vh - var(--topbar-h));
  display: flex; flex-direction: column;
}
body.rail-mini #page { margin-left: 84px; }
body.no-rail #page { margin-left: 0; }
body.no-rail .sidebar { display: none; }

.content { flex: 1; padding: 8px 20px 40px; }

.footer {
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding: 14px 20px 26px; color: var(--muted); font-size: 14px; border-top: 1px solid var(--line);
}
.build-badge { font-family: Consolas, monospace; font-size: var(--fs-micro); }

/* ------------------------------------------------------------------- chips */
.chips {
  position: sticky; top: var(--topbar-h); z-index: 15;
  display: flex; gap: 10px; padding: 10px 20px; overflow-x: auto;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  border-bottom: 1px solid var(--line); scrollbar-width: thin;
}
.chip {
  flex: none; border: 0; background: var(--surface-2); color: var(--fg);
  min-height: 44px; padding: 0 14px; border-radius: 10px; cursor: pointer; white-space: nowrap; font-weight: 600;
}
.chip:hover { background: var(--surface-3); }
.chip[aria-pressed="true"] { background: var(--fg); color: var(--bg); }

/* ------------------------------------------------------------------- cards */
.page-head { padding: 14px 2px 6px; }
.page-head h1 { margin: 12px 0 4px; font-size: 22px; letter-spacing: -.3px; }
.page-head p { margin: 0; color: var(--muted); max-width: 70ch; }

.grid {
  display: grid; gap: 22px 16px;
  grid-template-columns: repeat(auto-fill, minmax(292px, 1fr));
  padding: 12px 0 8px;
}
.grid.list { grid-template-columns: minmax(320px, 460px); justify-content: start; gap: 16px; }

.card { display: flex; flex-direction: column; gap: 10px; min-width: 0; position: relative; }
.card.list-row { flex-direction: row; gap: 12px; }
.card.list-row .thumb { width: 240px; flex: none; }
.card.list-row .card-body { min-width: 0; }

.thumb {
  position: relative; display: block; aspect-ratio: 16 / 9; border-radius: var(--radius);
  overflow: hidden; background: var(--surface-2);
}
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .25s ease; }
.thumb:hover img { transform: scale(1.03); }
.dur {
  position: absolute; right: 8px; bottom: 8px; background: rgba(0, 0, 0, .78); color: #fff;
  font-size: var(--fs-micro); font-weight: 600; padding: 2px 5px; border-radius: 5px; letter-spacing: .2px;
}
.badge {
  position: absolute; left: 8px; top: 8px; background: var(--accent); color: var(--accent-ink);
  font-size: var(--fs-micro); font-weight: 800; text-transform: uppercase; letter-spacing: .5px;
  padding: 3px 7px; border-radius: 5px;
}
.watch-later {
  position: absolute; right: 8px; top: 8px; background: rgba(0, 0, 0, .82); color: #fff;
  border: 0; border-radius: 6px; min-height: 44px; padding: 0 12px; font-size: var(--fs-micro);
  cursor: pointer; font-weight: 700;
}
.watch-later[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }
.card.list-row .watch-later {
  position: static; align-self: flex-start; background: transparent;
  color: var(--muted); border: 1px solid var(--line);
}
.card.list-row .watch-later[aria-pressed="true"] { color: var(--accent); border-color: var(--accent); }

.card-body { display: grid; grid-template-columns: 44px 1fr; gap: 10px; }
.card-body > a { display: grid; place-items: center; height: 44px; }
.card-body img.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--surface-2); }
.card-title { margin: 0; font-size: 15px; font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; }
.card-title a {
  display: -webkit-box; min-height: 44px;
  -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card-meta { color: var(--muted); font-size: 14px; overflow-wrap: anywhere; }
.card-meta .chan:hover { color: var(--fg); }
.card-meta .dot { margin: 0 5px; }

/* ------------------------------------------------------------------ shorts */
.shelf { padding: 16px 0 4px; }
.shelf-head { display: flex; align-items: center; gap: 8px; font-size: 17px; font-weight: 700; margin: 14px 0 10px; }
.shelf-head svg { width: 20px; height: 20px; color: var(--accent); }
.shelf-row { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 8px; scroll-snap-type: x mandatory; }
.short-tile {
  position: relative; flex: none; width: 172px; aspect-ratio: 9 / 16; border-radius: 14px;
  overflow: hidden; background: var(--surface-2); scroll-snap-align: start;
}
.short-tile img { width: 100%; height: 100%; object-fit: cover; }
.short-tile figcaption {
  position: absolute; inset: auto 0 0 0; padding: 26px 10px 10px; font-size: 14px; font-weight: 600;
  background-color: var(--overlay); background-image: linear-gradient(transparent, rgba(0, 0, 0, .5));
  color: #fff;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.short-tile .dur { background: rgba(0, 0, 0, .78); }

/* ------------------------------------------------------------------- watch */
.watch {
  display: grid; gap: 24px; grid-template-columns: minmax(0, 1fr) 402px;
  align-items: start; padding-top: 16px;
}
.player-shell { background: #000; border-radius: 14px; overflow: hidden; position: relative; max-height: 72vh; }
.player-shell video { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: contain; background: #000; }
.big-play {
  position: absolute; inset: 0; display: grid; place-items: center; border: 0; cursor: pointer;
  background: rgba(0, 0, 0, .25); color: #fff;
}
.play-tri {
  width: 68px; height: 48px; border-radius: 12px; background: var(--accent);
  display: grid; place-items: center;
}
.play-tri::after { content: ""; border-left: 16px solid var(--accent-ink); border-block: 10px solid transparent; margin-left: 4px; }
.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap;
}
.player-note {
  position: absolute; left: 12px; bottom: 74px; background: rgba(0, 0, 0, .78); color: #fff;
  padding: 8px 12px; border-radius: 8px; font-size: 14px; max-width: calc(100% - 24px);
}

.watch h1.title { font-size: 19px; margin: 16px 0 10px; line-height: 1.35; }
.watch .tags-row { color: var(--muted); font-size: 14px; margin: 0 0 12px; max-width: 70ch; }

.owner { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.owner img { width: 42px; height: 42px; border-radius: 50%; }
.owner .who { min-width: 0; margin-right: auto; }
.owner .who b { display: block; font-size: 15px; }
.owner .who span { color: var(--muted); font-size: 14px; }

.btn {
  display: inline-flex; align-items: center; gap: 7px; min-height: 44px; padding: 0 16px;
  border: 0; border-radius: 22px; background: var(--surface-2); cursor: pointer; font-weight: 600;
}
.btn:hover { background: var(--surface-3); }
.btn svg { width: 18px; height: 18px; }
.btn.primary { background: var(--fg); color: var(--bg); }
.btn.subbed { background: var(--surface-2); color: var(--muted); }
.seg { display: flex; flex: none; background: var(--surface-2); border-radius: 22px; overflow: hidden; }
.seg button {
  display: flex; align-items: center; gap: 7px; flex: none; min-width: 44px; min-height: 44px;
  padding: 0 16px; border: 0; background: transparent; cursor: pointer; font-weight: 600;
}
.seg button:hover { background: var(--surface-3); }
.seg button[aria-pressed="true"] { color: var(--accent); }
.seg button + button { border-left: 1px solid var(--line); }
.seg .count { font-variant-numeric: tabular-nums; }

.desc {
  background: var(--surface); border-radius: 12px; padding: 12px 14px; margin: 14px 0 0;
  font-size: 15px; position: relative; max-width: 70ch; overflow-wrap: anywhere;
}
.desc.collapsed { max-height: 52px; overflow: hidden; -webkit-mask-image: linear-gradient(#000 60%, transparent); }
.desc .desc-head { font-weight: 600; margin-bottom: 6px; }
.desc .body { white-space: pre-wrap; margin: 0; }
.desc .credit { color: var(--muted); font-size: 14px; margin-top: 10px; }
.desc a { color: var(--accent); text-decoration: underline; }
button.more {
  background: none; border: 0; color: var(--fg); font-weight: 700; cursor: pointer;
  padding: 0 12px; min-height: 44px; margin: 2px 0 0 2px; text-decoration: underline;
}

.related-col { display: flex; flex-direction: column; gap: 10px; }
.related-col h2 { font-size: 15px; margin: 14px 0 2px; }
.rel {
  display: grid; grid-template-columns: 168px 1fr; gap: 10px; padding: 6px; border-radius: 10px;
}
.rel:hover { background: var(--surface); }
.rel .thumb { aspect-ratio: 16 / 9; }
.rel h3 { margin: 6px 0 4px; font-size: 14px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* --------------------------------------------------------- comments block */
.comments { margin-top: 26px; max-width: 70ch; }
.comments-head { display: flex; align-items: center; gap: 18px; font-size: 16px; font-weight: 700; margin: 16px 0 10px; }
.comment-form { display: grid; grid-template-columns: 44px 1fr; gap: 12px; margin: 16px 0 22px; }
.comment-form .me-mini {
  width: 44px; height: 44px; border-radius: 50%; background: var(--accent); color: var(--accent-ink);
  display: grid; place-items: center; font-weight: 800;
}
.comment-form input {
  background: transparent; border: 0; border-bottom: 1px solid var(--line); color: var(--fg);
  padding: 10px 2px; font: inherit; font-size: 16px;
}
.comment-form input:focus { outline: none; border-color: var(--fg); }
.comment-form .form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 8px; }
.comment {
  display: grid; grid-template-columns: 44px 1fr; gap: 12px; padding: 8px 0;
}
.comment .who-c { font-size: 14px; font-weight: 600; }
.comment .who-c span { color: var(--muted); font-weight: 400; margin-left: 6px; font-size: 14px; }
.comment .pin { color: var(--muted); font-size: 14px; margin-bottom: 2px; }
.comment p { margin: 3px 0 6px; white-space: pre-wrap; }
.comment .c-actions { display: flex; align-items: center; gap: 4px; color: var(--muted); font-size: 14px; }
.comment .c-actions button {
  background: none; border: 0; cursor: pointer; color: inherit;
  display: inline-flex; align-items: center; justify-content: center; gap: 5px; min-width: 44px; min-height: 44px;
}
.comment .c-actions button:hover { color: var(--fg); }
.comment .c-owner { background: var(--surface-2); color: var(--muted); border-radius: 6px; padding: 1px 6px; font-size: var(--fs-micro); }
.avatar-dot {
  width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center;
  background: var(--surface-3); font-weight: 800; font-size: 14px;
}

/* ------------------------------------------------------------------ shorts feed */
.shorts-feed { height: calc(100vh - var(--topbar-h)); overflow-y: scroll; scroll-snap-type: y mandatory; padding: 0; }
.short-frame { position: relative; height: calc(100vh - var(--topbar-h)); scroll-snap-align: start; display: grid; place-items: center; background: #000; }
.short-frame .blur { position: absolute; inset: 0; }
.short-frame .blur img { width: 100%; height: 100%; object-fit: cover; filter: blur(28px) saturate(1.2); opacity: .5; }
.short-frame video { position: relative; height: 100%; width: auto; max-width: 100%; aspect-ratio: 9 / 16; object-fit: cover; }
.short-info {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 18px 18px 20px; color: #fff;
  background-color: var(--overlay); background-image: linear-gradient(transparent, rgba(0, 0, 0, .84) 45%);
}
.short-info h2 { margin: 8px 0 4px; font-size: 16px; }
.short-info .card-meta { color: #e8e8e8; }
.short-dock { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.short-dock button, .short-dock a, .short-dock .quiet {
  display: inline-flex; align-items: center; gap: 7px; min-height: 44px; padding: 0 14px;
  border-radius: 999px; border: 1px solid rgba(255, 255, 255, .34); background: rgba(0, 0, 0, .72);
  color: #fff; font: inherit; font-size: 14px; font-weight: 600; text-decoration: none; cursor: pointer;
}
.short-dock svg { width: 18px; height: 18px; }
.short-dock .n { color: #fff; }
.short-dock button[aria-pressed="true"] { background: var(--accent); border-color: transparent; color: var(--accent-ink); }
.short-dock button[aria-pressed="true"] .n { color: var(--accent-ink); }
.short-dock .quiet { opacity: .78; cursor: default; }
.audio-note { font-weight: 700; }

/* ------------------------------------------------------- channel + collections */
.channel-head {
  display: flex; gap: 20px; align-items: center; padding: 22px 2px 16px; border-bottom: 1px solid var(--line);
}
.channel-head img { width: 96px; height: 96px; border-radius: 50%; }
.channel-head h1 { margin: 8px 0 4px; font-size: 24px; }
.channel-head .card-meta { display: block; margin-bottom: 8px; }
.channel-head .about { max-width: 640px; color: var(--muted); margin: 0; }

.empty { text-align: center; color: var(--muted); padding: 72px 20px; }
.empty svg { width: 64px; height: 64px; color: var(--surface-3); margin-bottom: 10px; }
.empty h2 { color: var(--fg); margin: 12px 0 6px; }
.error-banner {
  background: #7d1a10; color: #fff; padding: 12px 16px; border-radius: 10px; margin: 12px 0;
  display: flex; gap: 12px; align-items: center;
}
.error-banner button {
  margin-left: auto; background: #fff; border: 0; color: #7d1a10;
  min-height: 44px; padding: 0 16px; border-radius: 10px; cursor: pointer; font-weight: 700;
}

/* --------------------------------------------------------------- skeletons */
.skel { padding: 12px 0; display: grid; gap: 22px 16px; grid-template-columns: repeat(auto-fill, minmax(292px, 1fr)); }
.skel-card { display: grid; gap: 10px; }
.skel .box { background: var(--surface-2); border-radius: var(--radius); position: relative; overflow: hidden; }
.skel .box.t { aspect-ratio: 16 / 9; }
.skel .box.l { height: 14px; }
.skel .box.l2 { height: 14px; width: 60%; }
.skel .box.t::after, .skel .box.l::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--fg) 10%, transparent), transparent);
  animation: shimmer 1.4s infinite; transform: translateX(-100%);
}
@keyframes shimmer { to { transform: translateX(100%); } }
@media (prefers-reduced-motion: reduce) {
  .skel .box.t::after, .skel .box.l::after { animation: none; }
  .thumb img { transition: none; }
  .sidebar { transition: none; }
}

/* ------------------------------------------------------------------ toast */
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 60;
  background: var(--surface-3); color: var(--fg); padding: 11px 18px; border-radius: 10px;
  box-shadow: var(--shadow); font-weight: 600; max-width: 82vw;
}

/* ------------------------------------------- results, collections, shorts feed */
.sortbar { display: flex; gap: 10px; padding: 0 2px 12px; }
.sortbar .chip[aria-pressed="true"] { background: var(--fg); color: var(--bg); }
.grid.list > div { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; min-width: 0; }
.watched-note { color: var(--muted); font-size: 14px; margin: 0; }
.chan-id { min-width: 0; }
.sub-group { margin: 4px 0 30px; }
.sub-group .shelf-head img { border-radius: 50%; }
.sub-group > .chan {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 4px;
  color: var(--muted); text-decoration: underline;
}
body[data-route="shorts"] .content { padding: 0; }
body[data-route="shorts"] .footer { border-top: 0; }

/* ------------------------------------------------------------- responsive */
@media (max-width: 1280px) {
  .watch { grid-template-columns: minmax(0, 1fr); }
  .related-col { flex-direction: row; flex-wrap: wrap; }
  .rel { width: calc(50% - 5px); }
}

@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); transition: transform .18s ease; box-shadow: var(--shadow); width: var(--rail-w); }
  body.drawer-open .sidebar { transform: none; display: block; }
  body.rail-mini .sidebar { width: var(--rail-w); }
  #page, body.rail-mini #page { margin-left: 0; }
  .topbar { gap: 6px; padding: 0 8px; }
  .topbar-right { gap: 4px; }
  .search { margin-left: 2px; flex-basis: 320px; }
  .topbar-left { min-width: 0; }
  .logo-word { display: none; }
  .createBtn, #createBtn { display: none; }
  .rel { width: 100%; }
  .grid { grid-template-columns: 1fr; }
  .card.list-row .thumb { width: 148px; }
  .content { padding: 8px 12px 32px; }
}

@media (max-width: 520px) {
  .search-btn { width: 46px; }
}
