:root {
  color-scheme: light;
  --bg: #f6f7fb;
  --surface: #ffffff;
  --surface-muted: #f0f4f8;
  --text: #172033;
  --muted: #667085;
  --border: #d9e0ea;
  --primary: #e62117;
  --primary-dark: #bc1d14;
  --accent: #0f766e;
  --danger: #b42318;
  --shadow: 0 18px 50px rgba(28, 38, 63, 0.12);
  --field-shadow: 0 1px 2px rgba(16, 24, 40, 0.05);
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    linear-gradient(135deg, rgba(230, 33, 23, 0.08), transparent 34%),
    linear-gradient(315deg, rgba(15, 118, 110, 0.10), transparent 38%),
    var(--bg);
}

button,
input,
a {
  font: inherit;
}

a {
  color: inherit;
}

.app-shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 56px 0;
}

.home-layout {
  display: grid;
  min-height: 100vh;
  grid-template-columns: 260px minmax(0, 1fr);
}

.hamburger,
.nav-backdrop,
.mobile-brand {
  display: none;
}

.sidebar {
  position: sticky;
  top: 0;
  align-self: start;
  display: flex;
  flex-direction: column;
  gap: 28px;
  height: 100vh;
  border-right: 1px solid rgba(217, 224, 234, 0.9);
  padding: 28px 18px;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(16px);
}

.sidebar-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-size: 1.1rem;
  font-weight: 900;
  text-decoration: none;
}

.brand-mark {
  display: inline-grid;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 8px;
  color: #ffffff;
  background: var(--primary);
  box-shadow: 0 10px 20px rgba(230, 33, 23, 0.18);
}

.brand-mark svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
}

.sidebar-nav {
  display: grid;
  gap: 8px;
}

.nav-link {
  display: flex;
  min-height: 42px;
  align-items: center;
  border-radius: 8px;
  padding: 0 12px;
  color: #475467;
  font-weight: 800;
  text-decoration: none;
}

.nav-link:hover {
  background: var(--surface-muted);
}

.nav-link.active {
  color: var(--primary-dark);
  background: rgba(230, 33, 23, 0.08);
}

.home-main {
  width: min(980px, calc(100% - 40px));
  margin: 0 auto;
  padding: 52px 0;
}

.add-channels-main {
  width: min(1120px, calc(100% - 40px));
}

.auth-area {
  position: relative;
  display: flex;
  min-height: 42px;
  margin-top: auto;
}

.sidebar-version {
  margin-top: -22px;
  padding: 0 14px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: rgba(15, 23, 42, 0.18);
  user-select: none;
  pointer-events: none;
}

.sidebar > .auth-area .profile-menu,
.sidebar > .auth-area .profile-summary {
  width: 100%;
}

.sidebar > .auth-area .profile-summary {
  justify-content: flex-start;
}

.sign-in-button,
.profile-summary,
.profile-option,
.auth-tab,
.auth-submit-button,
.auth-secondary-button {
  border: 0;
  cursor: pointer;
  font: inherit;
}

.sign-in-button {
  min-height: 40px;
  border-radius: 8px;
  padding: 0 14px;
  color: #ffffff;
  background: var(--primary);
  font-weight: 800;
  box-shadow: 0 12px 24px rgba(230, 33, 23, 0.18);
}

.sign-in-button:hover {
  background: var(--primary-dark);
}

.profile-menu {
  position: relative;
}

.profile-menu summary {
  list-style: none;
}

.profile-menu summary::-webkit-details-marker {
  display: none;
}

.profile-summary {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  gap: 9px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0 10px 0 6px;
  color: #344054;
  background: #ffffff;
  font-weight: 800;
}

.profile-summary:hover {
  background: var(--surface-muted);
}

.profile-avatar {
  display: inline-grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 999px;
  color: #ffffff;
  background: var(--accent);
  font-size: 0.82rem;
  font-weight: 900;
}

.profile-options {
  position: absolute;
  z-index: 10;
  bottom: calc(100% + 8px);
  left: 0;
  display: grid;
  min-width: 190px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px;
  background: #ffffff;
  box-shadow: 0 -8px 24px rgba(28, 38, 63, 0.12);
  box-shadow: var(--shadow);
}

.profile-option {
  min-height: 36px;
  border-radius: 8px;
  padding: 0 10px;
  color: #344054;
  background: transparent;
  text-align: left;
  font-weight: 700;
}

.profile-option:hover {
  background: var(--surface-muted);
}

.profile-option.logout {
  color: var(--danger);
}

body.auth-locked .home-layout,
body.auth-locked .app-shell {
  display: none;
}

.auth-screen {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 32px 16px;
}

.auth-card {
  width: min(100%, 430px);
  border: 1px solid rgba(217, 224, 234, 0.9);
  border-radius: 8px;
  padding: 28px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
}

.auth-card h1 {
  margin: 0;
  font-size: 1.8rem;
  line-height: 1.15;
}

.auth-copy,
.auth-helper {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.auth-helper {
  border: 1px dashed #c8d2df;
  border-radius: 8px;
  padding: 10px 12px;
  background: rgba(240, 244, 248, 0.72);
  font-size: 0.9rem;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-top: 22px;
  padding: 4px;
  border-radius: 8px;
  background: var(--surface-muted);
}

.auth-tab {
  min-height: 38px;
  border-radius: 8px;
  color: #475467;
  background: transparent;
  font-weight: 800;
}

.auth-tab.active {
  color: var(--primary-dark);
  background: #ffffff;
  box-shadow: var(--field-shadow);
}

.auth-form {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.auth-form[hidden] {
  display: none;
}

.dev-only {
  display: none !important;
}

html.is-dev .dev-only.nav-link {
  display: flex !important;
  color: #c1121f;
  border: 1px dashed rgba(193, 18, 31, 0.45);
}

html.is-dev .dev-only.nav-link:hover {
  background: rgba(193, 18, 31, 0.08);
}

.auth-field {
  display: grid;
  gap: 7px;
  color: #344054;
  font-size: 0.92rem;
  font-weight: 700;
}

.auth-field input {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 11px 13px;
  color: var(--text);
  background: var(--surface);
  box-shadow: var(--field-shadow);
  outline: none;
}

.auth-field input:focus {
  border-color: rgba(15, 118, 110, 0.75);
  box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.14);
}

.auth-password-wrap {
  position: relative;
  display: block;
}

.auth-password-wrap input {
  padding-right: 46px;
}

.auth-password-toggle {
  position: absolute;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  color: #6b7280;
  background: transparent;
  cursor: pointer;
}

.auth-password-toggle:hover,
.auth-password-toggle:focus-visible {
  color: var(--primary-dark);
  background: rgba(15, 118, 110, 0.08);
}

.auth-password-toggle svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.auth-password-toggle .icon-eye-off,
.auth-password-toggle[aria-pressed="true"] .icon-eye {
  display: none;
}

.auth-password-toggle[aria-pressed="true"] .icon-eye-off {
  display: block;
}

.auth-checkbox {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  color: #344054;
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.45;
}

.auth-checkbox input {
  width: 17px;
  height: 17px;
  margin-top: 2px;
  accent-color: var(--accent);
}

.auth-error {
  min-height: 20px;
  margin: 0;
  color: var(--danger);
  font-size: 0.88rem;
  font-weight: 700;
}

.auth-submit-button,
.auth-secondary-button {
  min-height: 44px;
  border-radius: 8px;
  padding: 0 16px;
  font-weight: 900;
}

.auth-submit-button {
  color: #ffffff;
  background: var(--primary);
  box-shadow: 0 12px 24px rgba(230, 33, 23, 0.18);
}

.auth-submit-button:hover {
  background: var(--primary-dark);
}

.auth-secondary-button {
  border: 1px solid var(--border);
  color: #344054;
  background: #ffffff;
}

.auth-secondary-button:hover {
  background: var(--surface-muted);
}

.home-header {
  margin-bottom: 28px;
}

.home-header h1 {
  margin: 0;
  font-size: clamp(2.1rem, 5vw, 3.8rem);
  line-height: 1;
  letter-spacing: 0;
}

.home-header p:not(.eyebrow) {
  max-width: 620px;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.55;
}

.video-dashboard {
  display: grid;
  gap: 16px;
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid rgba(217, 224, 234, 0.9);
  padding-bottom: 16px;
}

.section-heading h2 {
  margin: 0;
  font-size: 1.15rem;
  line-height: 1.25;
}

.section-heading p {
  margin: 6px 0 0;
  color: var(--muted);
}

.secondary-link {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0 13px;
  color: #344054;
  background: #ffffff;
  font-weight: 800;
  text-decoration: none;
  transition: transform 160ms ease, background-color 160ms ease, box-shadow 160ms ease;
}

.secondary-link:hover {
  transform: translateY(-1px);
  background: var(--surface-muted);
}

.latest-video-list {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.latest-video-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 8px 24px rgba(28, 38, 63, 0.06);
}

.latest-video-link {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  padding: 12px;
  text-decoration: none;
}

.latest-video-link:hover .latest-video-title {
  color: var(--primary-dark);
}

.video-thumbnail {
  display: grid;
  aspect-ratio: 16 / 9;
  place-items: center;
  border-radius: 8px;
  color: #ffffff;
  background:
    linear-gradient(135deg, rgba(230, 33, 23, 0.92), rgba(15, 118, 110, 0.82)),
    #1f2937;
}

.video-thumbnail svg {
  width: 34px;
  height: 34px;
  fill: currentColor;
}

.latest-video-content {
  display: grid;
  min-width: 0;
  gap: 6px;
}

.latest-video-title {
  color: var(--text);
  font-size: 1rem;
  font-weight: 900;
  line-height: 1.35;
}

.latest-video-channel {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.45;
}

.my-channel-list {
  display: grid;
  grid-template-columns: repeat(var(--column-count, 4), minmax(0, 1fr));
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.my-channel-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 8px 24px rgba(28, 38, 63, 0.06);
  aspect-ratio: 1 / 1;
  overflow: hidden;
}

.my-channel-card.has-unwatched {
  border-color: var(--primary, #e62117);
  box-shadow: 0 4px 10px rgba(230, 33, 23, 0.18);
}

.my-channel-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 100%;
  padding: 14px;
  text-align: center;
  text-decoration: none;
}

.my-channel-link:hover .my-channel-name {
  color: var(--primary-dark);
}

.channel-avatar {
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  border-radius: 8px;
  color: #ffffff;
  background:
    linear-gradient(135deg, rgba(230, 33, 23, 0.92), rgba(15, 118, 110, 0.82)),
    #1f2937;
  font-size: 1.35rem;
  font-weight: 900;
}

.my-channel-card .channel-avatar {
  width: 60%;
  height: auto;
  aspect-ratio: 1 / 1;
  font-size: clamp(1.1rem, 3vw, 1.6rem);
}

.my-channel-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-width: 0;
  width: 100%;
}

.my-channel-name {
  display: block;
  width: 100%;
  min-width: 0;
  color: var(--text);
  font-size: clamp(0.85rem, 1.1vw, 1rem);
  font-weight: 900;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.my-channel-url {
  display: none;
}

.my-channel-tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin-top: 2px;
  max-width: 100%;
}

.my-channel-tags .tag-chip {
  display: inline-block;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.back-link {
  width: fit-content;
  margin-bottom: 22px;
}

.channel-page-header {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  margin-bottom: 28px;
}

.channel-page-header .channel-avatar {
  width: 72px;
  height: 72px;
}

.channel-page-header h1 {
  margin: 0;
  font-size: clamp(2rem, 5vw, 3.4rem);
  line-height: 1;
  letter-spacing: 0;
}

.channel-page-header p:not(.eyebrow) {
  max-width: 720px;
  margin: 12px 0 0;
  overflow-wrap: anywhere;
  color: var(--muted);
  line-height: 1.55;
}

.video-filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 14px;
  padding: 12px 14px;
  margin-bottom: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
}

.video-filter-count {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.video-filter-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  margin-left: auto;
  align-self: start;
}

.video-bulk-actions {
  position: relative;
}

.video-bulk-actions-summary {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  list-style: none;
  cursor: pointer;
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #ffffff;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 600;
  user-select: none;
}

.video-bulk-actions-summary::-webkit-details-marker { display: none; }

.video-bulk-actions-summary::after {
  content: "\25BE";
  font-size: 0.7rem;
}

.video-bulk-actions[open] .video-bulk-actions-summary {
  background: var(--surface-muted, #f5f7fb);
  color: var(--text);
}

.video-bulk-actions-menu {
  position: absolute;
  z-index: 20;
  top: calc(100% + 6px);
  right: 0;
  display: flex;
  flex-direction: column;
  min-width: 220px;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 12px 28px rgba(28, 38, 63, 0.14);
}

.video-bulk-action {
  display: block;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  text-align: left;
  font: inherit;
  color: var(--text);
  cursor: pointer;
}

.video-bulk-action:hover {
  background: #f5f7fb;
}

.video-bulk-action-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-top: 1px solid var(--border);
  margin-top: 4px;
  cursor: pointer;
  font-size: 0.92rem;
  color: var(--text);
}

.video-bulk-action-checkbox:hover {
  background: #f5f7fb;
}

.video-bulk-action-checkbox input[type="checkbox"] {
  margin: 0;
  cursor: pointer;
}

.video-bulk-action-danger {
  margin-top: 4px;
  border-top: 1px solid var(--border);
  padding-top: 10px;
  color: var(--danger, #b91c1c);
  font-weight: 600;
}

.video-bulk-action-danger:hover {
  background: rgba(185, 28, 28, 0.08);
}

.video-filter-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.85rem;
  color: var(--muted);
}

.video-filter-field input[type="date"] {
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font: inherit;
  color: var(--text);
  background: #ffffff;
}

.video-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 18px;
}

.video-pagination[hidden] {
  display: none;
}

.video-pagination-status {
  font-size: 0.92rem;
  color: var(--muted);
}

.channel-video-list {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.channel-video-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 8px 24px rgba(28, 38, 63, 0.06);
  transition: box-shadow 220ms ease, border-radius 220ms ease;
}

.channel-video-link {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr);
  gap: 32px;
  align-items: center;
  padding: 12px;
  text-decoration: none;
  transition: grid-template-columns 220ms ease, gap 220ms ease, padding 220ms ease;
}

.channel-video-link:hover .channel-video-title {
  color: var(--primary-dark);
}

.channel-video-thumbnail {
  position: relative;
  display: grid;
  width: 160px;
  aspect-ratio: 16 / 9;
  place-items: center;
  border-radius: 8px;
  overflow: hidden;
  color: #ffffff;
  background:
    linear-gradient(135deg, rgba(230, 33, 23, 0.92), rgba(15, 118, 110, 0.82)),
    #1f2937;
  font-size: 0.82rem;
  font-weight: 900;
  transition: width 220ms ease;
}

.channel-video-thumbnail img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.channel-video-thumbnail iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.channel-video-card.expanded {
  border-radius: 14px;
  box-shadow: 0 18px 40px rgba(28, 38, 63, 0.18);
}

.channel-video-card.expanded .channel-video-link {
  grid-template-columns: 1fr;
  gap: 12px;
  padding: 14px;
}

.channel-video-card.expanded .channel-video-thumbnail {
  width: 100%;
  border-radius: 10px;
  background: #0e0f12;
}

.channel-video-card.expanded .channel-video-title {
  font-size: 1.05rem;
}

.channel-video-content {
  display: grid;
  min-width: 0;
  gap: 8px;
}

.channel-video-title-row {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.channel-video-title {
  color: var(--text);
  font-size: 1rem;
  font-weight: 900;
  line-height: 1.35;
  min-width: 0;
  overflow-wrap: anywhere;
}

.channel-video-date {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.channel-video-duration-text {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
  font-variant-numeric: tabular-nums;
}

.channel-video-date-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.channel-video-duration {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 4px;
  background: rgba(28, 38, 63, 0.08);
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.channel-with-ads__content {
  min-width: 0;
}

.legal-page {
  max-width: 720px;
  margin: 0 auto;
  padding: 40px 20px 64px;
  line-height: 1.6;
  color: var(--text);
}
.legal-page h1 { margin-top: 0; }
.legal-page h2 { margin-top: 1.75rem; font-size: 1.1rem; }
.legal-page code { background: var(--surface-muted, #f5f7fb); padding: 1px 5px; border-radius: 3px; font-size: 0.9em; }
.legal-page a { color: var(--accent); }

.app-footer {
  margin-top: 40px;
  padding: 20px 0;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 32px;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  text-align: center;
  font-size: 0.85rem;
  color: var(--muted);
}
.app-footer a {
  color: var(--muted);
  text-decoration: none;
}
.app-footer a:hover { color: var(--text); text-decoration: underline; }

.settings-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  cursor: pointer;
  font-size: 0.95rem;
  color: var(--text);
}
.settings-toggle input[type="checkbox"] {
  margin: 0;
  cursor: pointer;
}
.settings-toggle small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.35;
}
.settings-field {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  font-size: 0.95rem;
  color: var(--text);
}
.settings-field select {
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  font-size: 0.95rem;
  cursor: pointer;
}
.settings-links {
  list-style: none;
  padding: 0;
  margin: 8px 0 0;
  display: flex;
  gap: 16px;
}
.settings-links a {
  color: var(--accent);
  text-decoration: none;
}
.settings-links a:hover { text-decoration: underline; }

.settings-danger-copy {
  margin: 8px 0 12px;
  color: var(--muted);
  line-height: 1.5;
  max-width: 560px;
}

.settings-danger-error {
  margin: 10px 0 0;
  color: var(--danger);
  font-weight: 700;
}

.danger-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid var(--danger);
  border-radius: 8px;
  color: var(--danger);
  background: #ffffff;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.danger-button:hover {
  color: #ffffff;
  background: var(--danger);
}

.danger-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.my-channel-card.ad-tile {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  background: rgba(255, 255, 255, 0.92);
}
.my-channel-card.ad-tile iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}
.my-channel-card.ad-tile .channel-ads-placeholder {
  font-size: 0.72rem;
  text-align: center;
  color: var(--muted);
  padding: 8px;
  border: 1px dashed var(--border);
  border-radius: 6px;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.channel-video-infinite-sentinel {
  list-style: none;
  height: 1px;
  visibility: hidden;
  pointer-events: none;
}

.channel-video-card.expanded .channel-video-inline-message {
  position: absolute;
  inset: 0;
  margin: 0;
  display: grid;
  place-items: center;
  padding: 16px;
  color: #fff;
  background: rgba(0, 0, 0, 0.85);
  text-align: center;
}

.channel-video-card.expanded .channel-video-thumbnail .primary-button {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
}

.channel-video-card.ad-tile {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px;
}
.channel-video-card.ad-tile iframe {
  display: block;
  width: 100%;
  height: 250px;
  border: 0;
}
.channel-video-card.ad-tile .channel-ads-placeholder {
  font-size: 0.85rem;
  text-align: center;
  color: var(--muted);
  padding: 16px;
  border: 1px dashed var(--border);
  border-radius: 6px;
}

.channel-ads {
  display: none;
}

@media (min-width: 1100px) {
  .channel-with-ads {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 24px;
    align-items: start;
  }
  .channel-ads {
    display: block;
    position: sticky;
    top: 1rem;
    min-height: 600px;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #ffffff;
  }
  .channel-ads-placeholder {
    color: var(--muted);
    font-size: 0.8rem;
    line-height: 1.4;
    text-align: center;
    padding: 20px 8px;
    border: 1px dashed var(--border);
    border-radius: 6px;
  }
  body.ads-disabled .channel-with-ads {
    display: block;
  }
  body.ads-disabled .channel-ads {
    display: none;
  }
}

.channel-video-watched {
  width: 16px;
  height: 16px;
  margin: 0;
  flex: 0 0 auto;
  cursor: pointer;
  accent-color: var(--primary, #0d6b8e);
}

.channel-video-card.watched .channel-video-title,
.channel-video-card.watched .channel-video-date {
  opacity: 0.55;
}

.page-header {
  max-width: 760px;
  margin-bottom: 30px;
}

.eyebrow {
  display: none;
  width: fit-content;
  margin: 0 0 12px;
  padding: 6px 10px;
  border: 1px solid rgba(230, 33, 23, 0.18);
  border-radius: 999px;
  color: var(--primary-dark);
  background: rgba(255, 255, 255, 0.78);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.page-header h1 {
  margin: 0;
  font-size: clamp(2.2rem, 5vw, 4.3rem);
  line-height: 1;
  letter-spacing: 0;
}

.page-header p:not(.eyebrow) {
  max-width: 620px;
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 1.1rem;
  line-height: 1.6;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(300px, 0.82fr) minmax(380px, 1.18fr);
  gap: 24px;
  align-items: start;
}

.panel {
  border: 1px solid rgba(217, 224, 234, 0.9);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
}

.form-panel {
  position: sticky;
  top: 24px;
}

.panel-heading {
  padding: 24px 24px 0;
}

.panel-heading h2 {
  margin: 0;
  font-size: 1.15rem;
  line-height: 1.25;
}

.panel-heading p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.channel-form {
  display: grid;
  gap: 18px;
  padding: 24px;
}

.channel-form.is-busy {
  opacity: 0.6;
  pointer-events: none;
  cursor: wait;
}

.field-group {
  display: grid;
  gap: 8px;
}

.field-group label {
  color: #344054;
  font-size: 0.92rem;
  font-weight: 700;
}

.field-group input {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 11px 13px;
  color: var(--text);
  background: var(--surface);
  box-shadow: var(--field-shadow);
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.field-group input:focus {
  border-color: rgba(15, 118, 110, 0.75);
  box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.14);
}

.field-group input[aria-invalid="true"] {
  border-color: rgba(180, 35, 24, 0.7);
}

.tag-editor {
  display: flex;
  width: 100%;
  min-height: 46px;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px;
  background: var(--surface);
  box-shadow: var(--field-shadow);
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.tag-editor:focus-within {
  border-color: rgba(15, 118, 110, 0.75);
  box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.14);
}

.tag-editor input {
  flex: 1 1 140px;
  width: auto;
  min-width: min(100%, 140px);
  min-height: 32px;
  border: 0;
  padding: 4px 6px;
  background: transparent;
  box-shadow: none;
}

.tag-editor input:focus {
  border-color: transparent;
  box-shadow: none;
}

.assigned-tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.assigned-tag-list[hidden] {
  display: none;
}

.assigned-tag-chip {
  display: inline-flex;
  max-width: 100%;
  min-height: 30px;
  align-items: center;
  border: 1px solid rgba(15, 118, 110, 0.18);
  border-radius: 999px;
  padding: 3px 4px 3px 9px;
  color: #0f3f3a;
  background: #e4f6f3;
  font-size: 0.82rem;
  font-weight: 800;
  line-height: 1.35;
}

.assigned-tag-label {
  max-width: 100%;
  overflow-wrap: anywhere;
}

.assigned-tag-remove {
  display: inline-grid;
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  place-items: center;
  margin-left: 4px;
  border-radius: 999px;
  color: #0f766e;
  background: transparent;
}

.assigned-tag-remove:hover {
  color: #ffffff;
  background: var(--danger);
}

.assigned-tag-remove svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.4;
}

.error-message {
  min-height: 18px;
  margin: 0;
  color: var(--danger);
  font-size: 0.85rem;
}

.field-warning {
  margin: 4px 0 0;
  padding: 6px 10px;
  border-radius: 6px;
  background: #fef3c7;
  color: #92400e;
  font-size: 0.85rem;
  line-height: 1.35;
}

.field-warning[hidden] {
  display: none;
}

.platform-badge {
  display: inline-flex;
  align-items: center;
  justify-self: start;
  width: max-content;
  margin-top: 4px;
  padding: 3px 9px;
  border: 1px solid transparent;
  border-radius: 999px;
  min-height: 26px;
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1.35;
}

.platform-badge.youtube {
  background: #ffe4e3;
  color: #b91c1c;
  border-color: rgba(185, 28, 28, 0.25);
}

.platform-badge.rumble {
  background: #dcfce7;
  color: #166534;
  border-color: rgba(22, 101, 52, 0.25);
}

.platform-badge.unknown {
  background: #fef3c7;
  color: #92400e;
  border-color: rgba(146, 64, 14, 0.25);
}

.platform-badge[hidden] {
  display: none;
}

.import-status {
  margin: 10px 0 0;
  padding: 8px 12px;
  border-radius: 6px;
  background: #e0f2fe;
  color: #075985;
  font-size: 0.9rem;
  line-height: 1.35;
}

.import-status[hidden] {
  display: none;
}

.channel-form.is-busy {
  opacity: 0.55;
  transition: opacity 0.15s ease;
}

.form-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  padding-top: 4px;
}

.primary-button,
.secondary-button,
.icon-button,
.text-button,
.filter-chip,
.assigned-tag-remove {
  border: 0;
  cursor: pointer;
  transition: transform 160ms ease, background-color 160ms ease, box-shadow 160ms ease;
}

.primary-button,
.secondary-button {
  min-height: 44px;
  border-radius: 8px;
  padding: 0 16px;
  font-weight: 800;
}

.primary-button {
  color: #ffffff;
  background: var(--primary);
  box-shadow: 0 12px 24px rgba(230, 33, 23, 0.18);
}

.primary-button:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
}

.secondary-button {
  border: 1px solid var(--border);
  color: #344054;
  background: #ffffff;
}

.secondary-button:hover {
  background: var(--surface-muted);
}

.secondary-button:disabled,
.secondary-button[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
  background: #ffffff;
}

.secondary-button:disabled:hover,
.secondary-button[disabled]:hover {
  background: #ffffff;
}

.text-button {
  border-radius: 8px;
  padding: 7px 8px;
  color: var(--primary-dark);
  background: transparent;
  font-size: 0.86rem;
  font-weight: 800;
}

.text-button:hover {
  background: rgba(230, 33, 23, 0.08);
}

.list-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 24px;
}

.list-toolbar > #channel-count {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.list-toolbar .tag-filter-area {
  margin: 0;
  padding: 0;
  border: 0;
}

.list-heading {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 18px;
}

.tag-filter-area {
  margin: 0 24px 18px;
  padding-top: 16px;
  border-top: 1px solid rgba(217, 224, 234, 0.9);
}

.tag-filter-area[hidden] {
  display: none;
}

.home-tag-filter-area {
  margin: 0;
  padding-top: 0;
  border-top: 0;
}

.tag-filter-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}


.tag-filter-header h3 {
  margin: 0;
  color: #344054;
  font-size: 0.92rem;
  line-height: 1.3;
}

.tag-filter-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-filter-dropdown {
  position: relative;
}

.channel-sort-dropdown {
  position: relative;
  margin-left: auto;
}

.channel-sort-option {
  display: block;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  text-align: left;
  font: inherit;
  color: var(--text);
  cursor: pointer;
}

.channel-sort-option:hover {
  background: #f5f7fb;
}

.tag-filter-summary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border: 1px solid #c8d2df;
  border-radius: 999px;
  font-size: 0.9rem;
  color: #344054;
  background: #ffffff;
  cursor: pointer;
  user-select: none;
  list-style: none;
}

.tag-filter-summary::-webkit-details-marker {
  display: none;
}

.tag-filter-summary::after {
  content: "\25BE";
  font-size: 0.7rem;
  color: #6b7280;
}

.tag-filter-dropdown[open] .tag-filter-summary {
  border-color: rgba(15, 118, 110, 0.62);
  color: #064e3b;
  background: #ccfbf1;
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}

.tag-filter-menu {
  position: absolute;
  z-index: 20;
  top: calc(100% + 6px);
  right: 0;
  display: flex;
  flex-direction: column;
  min-width: 200px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 12px 28px rgba(28, 38, 63, 0.14);
}

.tag-filter-options {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 240px;
  overflow-y: auto;
}

.tag-filter-options:empty::before {
  content: "No tags";
  color: var(--muted);
  font-size: 0.9rem;
  padding: 4px 8px;
}

.tag-filter-show-all {
  margin-top: 6px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
  text-align: center;
}

.tag-filter-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.92rem;
  color: var(--text);
}

.tag-filter-option:hover {
  background: #f5f7fb;
}

.tag-filter-option input[type="checkbox"] {
  margin: 0;
  cursor: pointer;
}

.filter-chip {
  min-height: 34px;
  max-width: 100%;
  border: 1px solid #c8d2df;
  border-radius: 999px;
  padding: 0 12px;
  color: #344054;
  background: #ffffff;
  font-size: 0.86rem;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.filter-chip:hover {
  transform: translateY(-1px);
  border-color: rgba(15, 118, 110, 0.45);
  background: #f0fdfa;
}

.filter-chip.active {
  border-color: rgba(15, 118, 110, 0.62);
  color: #064e3b;
  background: #ccfbf1;
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}

.channel-list {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0 24px 24px;
  list-style: none;
}

.channel-card {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  background: #ffffff;
  box-shadow: 0 8px 24px rgba(28, 38, 63, 0.06);
}

.channel-card-avatar {
  width: 58px;
  height: 58px;
  border-radius: 8px;
  object-fit: cover;
  display: block;
  background: var(--surface-muted);
}

.channel-card-avatar.fallback {
  display: grid;
  place-items: center;
  color: #ffffff;
  background:
    linear-gradient(135deg, rgba(230, 33, 23, 0.92), rgba(15, 118, 110, 0.82)),
    #1f2937;
  font-weight: 900;
  font-size: 1.35rem;
}

.channel-meta {
  min-width: 0;
}

.channel-meta h3 {
  margin: 0;
  font-size: 1rem;
  line-height: 1.35;
}

.channel-meta a {
  display: block;
  width: fit-content;
  max-width: 100%;
  margin-top: 6px;
  overflow-wrap: anywhere;
  color: var(--accent);
  font-size: 0.92rem;
  line-height: 1.45;
  text-decoration: none;
}

.channel-meta a:hover {
  text-decoration: underline;
}

.channel-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.tag-chip {
  display: inline-flex;
  max-width: 100%;
  min-height: 26px;
  align-items: center;
  border: 1px solid rgba(15, 118, 110, 0.16);
  border-radius: 999px;
  padding: 3px 9px;
  color: #0f3f3a;
  background: #e4f6f3;
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.channel-actions {
  display: flex;
  gap: 8px;
}

.icon-button {
  display: inline-grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 8px;
  color: #475467;
  background: var(--surface-muted);
}

.icon-button:hover {
  transform: translateY(-1px);
  background: #e5eaf0;
}

.icon-button.delete:hover {
  color: var(--danger);
  background: #fee4e2;
}

.icon-button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.empty-state {
  margin: 0 24px 24px;
  border: 1px dashed #c8d2df;
  border-radius: 8px;
  padding: 32px 24px;
  text-align: center;
  background: rgba(240, 244, 248, 0.72);
}

.empty-state[hidden] {
  display: none;
}

.home-empty-state {
  margin: 0;
}

.empty-state-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 14px;
  text-decoration: none;
}

.empty-icon {
  display: inline-grid;
  width: 54px;
  height: 54px;
  place-items: center;
  border-radius: 8px;
  color: var(--primary);
  background: #ffffff;
  box-shadow: 0 10px 24px rgba(28, 38, 63, 0.08);
}

.empty-icon svg {
  width: 28px;
  height: 28px;
  fill: currentColor;
}

.empty-state h3 {
  margin: 16px 0 6px;
  font-size: 1.05rem;
}

.empty-state p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

@media (max-width: 780px) {
  .app-shell {
    width: min(100% - 24px, 620px);
    padding: 32px 0;
  }

  .home-layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 30;
    width: min(82%, 320px);
    height: 100vh;
    border-right: 1px solid rgba(217, 224, 234, 0.9);
    border-bottom: 0;
    padding: 28px 18px;
    transform: translateX(-100%);
    transition: transform 200ms ease;
  }

  body.nav-open .sidebar {
    transform: translateX(0);
    box-shadow: 0 0 40px rgba(28, 38, 63, 0.25);
  }

  body.nav-open .nav-backdrop {
    opacity: 1;
    pointer-events: auto;
  }

  .nav-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 25;
    background: rgba(15, 23, 42, 0.4);
    opacity: 0;
    pointer-events: none;
    transition: opacity 200ms ease;
  }

  .hamburger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    top: 12px;
    right: 12px;
    z-index: 40;
    width: 44px;
    height: 44px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #ffffff;
    color: #1f2937;
    font-size: 1.6rem;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(28, 38, 63, 0.12);
  }

  .sidebar-brand {
    display: none !important;
  }

  .mobile-brand {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 1;
    padding: 4px 12px 4px 6px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #ffffff;
    color: var(--text);
    font-size: 1rem;
    font-weight: 900;
    text-decoration: none;
    box-shadow: 0 4px 14px rgba(28, 38, 63, 0.12);
  }

  .mobile-brand .brand-mark {
    width: 34px;
    height: 34px;
  }

  .mobile-brand .brand-mark svg {
    width: 22px;
    height: 22px;
  }

  .home-main {
    width: 100%;
    padding: 64px 16px 32px;
  }

  .my-channel-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }

  .my-channel-link {
    padding: 7px;
    gap: 5px;
  }

  .video-filter-count {
    margin: 0;
    align-self: end;
  }

  #video-filter-reset {
    order: 1;
  }

  .my-channel-card .channel-avatar {
    width: 90%;
  }

  .my-channel-content {
    display: none;
  }

  .section-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .form-panel {
    position: static;
  }

 .channel-card {
    grid-template-columns: 58px minmax(0, 1fr);
  }

  .channel-actions {
    grid-column: 2;
    justify-content: flex-start;
  }
}

img.channel-avatar {
  object-fit: cover;
  display: block;
}

@media (max-width: 460px) {
  .latest-video-link,
  .my-channel-link,
  .channel-video-link {
    grid-template-columns: 1fr;
  }

  .video-thumbnail,
  .channel-avatar,
  .channel-video-thumbnail {
    width: 100%;
  }

  .channel-avatar {
    height: 72px;
  }

  .channel-page-header {
    grid-template-columns: 1fr;
  }

  .panel-heading,
  .channel-form {
    padding-right: 18px;
    padding-left: 18px;
  }

  .channel-list {
    padding-right: 18px;
    padding-left: 18px;
  }

  .tag-filter-area {
    margin-right: 18px;
    margin-left: 18px;
  }

  .tag-filter-header {
    flex-wrap: wrap;
    gap: 8px;
  }

  .empty-state {
    margin-right: 18px;
    margin-left: 18px;
  }

  .primary-button,
  .secondary-button {
    width: 100%;
  }
}

.watch-video-list {
  margin-bottom: 14px;
}

.browse-main {
  width: 100%;
  max-width: 100%;
  padding: 32px 0 60px;
}

.browse-header {
  width: min(980px, calc(100% - 40px));
  margin: 0 auto 18px;
}

.browse-header h1 {
  margin: 4px 0 6px;
  font-size: clamp(1.6rem, 4vw, 2.4rem);
}

.browse-header p:not(.eyebrow) {
  margin: 0;
  color: var(--muted);
}

.browse-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
  width: min(980px, calc(100% - 40px));
  margin: 0 auto 18px;
}

.browse-shorts-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
  font-size: 0.9rem;
  color: var(--text);
}

.browse-shorts-toggle input[type="checkbox"] {
  margin: 0;
  cursor: pointer;
}

.browse-stage {
  position: relative;
  width: 100%;
  margin-top: 8px;
  --center-card-half: clamp(160px, 30%, 550px);
}

.browse-arrow {
  --arrow-size: 44px;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 25;
  width: var(--arrow-size);
  height: var(--arrow-size);
  border-radius: 50%;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.92);
  color: var(--text);
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  box-shadow: 0 8px 20px rgba(28, 38, 63, 0.12);
}

.browse-arrow:hover {
  background: #fff;
}

.browse-arrow-prev {
  right: calc(50% + var(--center-card-half) - var(--arrow-size) / 2);
  left: auto;
}

.browse-arrow-next {
  left: calc(50% + var(--center-card-half) - var(--arrow-size) / 2);
  right: auto;
}

.browse-carousel {
  display: flex;
  gap: 18px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  padding: 28px 20%;
  outline: none;
}

.browse-carousel::-webkit-scrollbar {
  display: none;
}

.browse-card {
  flex: 0 0 100%;
  max-width: 1100px;
  min-width: 320px;
  scroll-snap-align: center;
  display: grid;
  grid-template-rows: auto auto;
  gap: 12px;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  cursor: pointer;
  transform: scale(0.6);
  opacity: 0.35;
  transition: transform 220ms ease, opacity 220ms ease, box-shadow 220ms ease;
  outline: none;
}

.browse-card.adjacent-left {
  transform: scale(0.7) translateX(35%);
  opacity: 0.55;
  z-index: 2;
}

.browse-card.adjacent-right {
  transform: scale(0.7) translateX(-35%);
  opacity: 0.55;
  z-index: 2;
}

.browse-card.far-left {
  transform: scale(0.55) translateX(65%);
  opacity: 0.25;
  z-index: 1;
}

.browse-card.far-right {
  transform: scale(0.55) translateX(-65%);
  opacity: 0.25;
  z-index: 1;
}

.browse-card.centered {
  transform: scale(1);
  opacity: 1;
  z-index: 10;
  box-shadow: 0 18px 40px rgba(28, 38, 63, 0.18);
}

.browse-card-thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #0e0f12;
  border-radius: 10px;
  overflow: hidden;
}

.browse-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.browse-card-thumb-fallback {
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 2rem;
}

.browse-card-iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

.browse-stage-player {
  position: absolute;
  z-index: 20;
  background: #0e0f12;
  border-radius: 10px;
  overflow: hidden;
  pointer-events: auto;
}

.browse-stage-player[hidden] {
  display: none;
}

.browse-stage-player iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.browse-card-meta {
  display: grid;
  gap: 6px;
}

.browse-card-channel-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.browse-card-avatar {
  width: 28px;
  height: 28px;
  font-size: 0.8rem;
}

.browse-card-channel-row .channel-avatar {
  width: 28px;
  height: 28px;
}

.browse-card-channel {
  font-size: 0.85rem;
  color: var(--muted);
  font-weight: 600;
}

.browse-card-title-row {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.browse-card-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-width: 0;
}

.browse-card-date {
  margin: 0;
  font-size: 0.82rem;
  color: var(--muted);
}

.browse-card-duration {
  margin: 0;
  font-size: 0.82rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.browse-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.browse-card-bottom-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}

.browse-card-bottom-row .browse-card-duration {
  flex: 0 0 auto;
}

.browse-card-bottom-row .browse-card-tags {
  flex: 1 1 auto;
}

.browse-card-watched-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  cursor: pointer;
  user-select: none;
  font-size: 0.9rem;
  color: var(--text);
}

.browse-card-watched-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin: 0;
  cursor: pointer;
  accent-color: var(--primary, #e62117);
}

@media (max-width: 780px) {
  .browse-stage {
    --center-card-half: 42.5%;
  }
  .browse-carousel {
    padding: 20px 7.5%;
  }
  .browse-card {
    flex: 0 0 100%;
  }
  .browse-arrow {
    --arrow-size: 36px;
    font-size: 1.3rem;
  }
}

@media (max-width: 460px) {
  .browse-stage {
    --center-card-half: 46%;
  }
  .browse-carousel {
    padding: 16px 4%;
  }
  .browse-card {
    flex: 0 0 100%;
  }
}


.watch-video-link {
  cursor: default;
}

#watch-video-card .channel-video-title {
  color: #000;
}

.watch-card {
  width: min(820px, calc(100% - 16px));
  margin: 0 auto;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  box-shadow: 0 18px 40px rgba(28, 38, 63, 0.12);
  display: grid;
  gap: 12px;
}

.watch-card-meta {
  display: grid;
  gap: 6px;
}

.watch-card-channel-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.watch-card-avatar {
  width: 32px;
  height: 32px;
  font-size: 0.85rem;
}

.watch-card-channel {
  font-size: 0.9rem;
  color: var(--muted);
  font-weight: 600;
}

.watch-card-title {
  margin: 0;
  font-size: clamp(1rem, 2vw, 1.25rem);
  font-weight: 700;
  line-height: 1.3;
  color: #000;
}

.watch-card-date {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.watch-card-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  font-size: 0.9rem;
  color: var(--text);
  cursor: pointer;
  user-select: none;
}

.watch-card-actions input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin: 0;
  cursor: pointer;
  accent-color: var(--primary, #e62117);
}

.watch-card.watched .watch-card-title,
.watch-card.watched .watch-card-date {
  opacity: 0.55;
}

.watch-player {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 0;
}

.watch-player:empty {
  display: none;
}

.watch-iframe,
.watch-player iframe,
#yt-player {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.watch-external-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: flex-start;
  padding: 18px;
  background: var(--surface, #1a1a1a);
  border-radius: 12px;
  margin-bottom: 18px;
}

.watch-external-thumbnail {
  width: 100%;
  max-width: 480px;
  border-radius: 8px;
}

.watch-external-message {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}


