/* YouToBox 1.0 — YouTube-familiar, Persian RTL product interface */
:root {
  --ytb-header-h: 64px;
  --ytb-sidebar-w: 240px;
  --ytb-sidebar-collapsed-w: 72px;
  --ytb-radius-media: 12px;
  --ytb-radius-control: 999px;
  --ytb-shadow-menu: 0 4px 32px rgba(15, 15, 15, .16);
  --ytb-press: scale(.96);
  --ytb-motion-fast: 140ms;
  --ytb-motion-medium: 220ms;
  font-synthesis: none;
}

html { min-height: 100%; background: var(--ytb-bg); scroll-behavior: smooth; }
body { min-height: 100%; overflow-x: hidden; }
body, .ytb-header, .ytb-sidebar, .ytb-chip-rail, .ytb-popover, .ytb-modal, input, textarea, select { transition: background-color var(--ytb-motion-medium) ease, color var(--ytb-motion-medium) ease, border-color var(--ytb-motion-medium) ease; }
body, button, input, textarea, select { font: inherit; }
body, h1, h2, h3, p { margin: 0; }
button, input, textarea, select { color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .55; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }
svg { flex: 0 0 auto; }
::selection { color: #fff; background: var(--ytb-brand); }

:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--ytb-focus) 45%, transparent);
  outline-offset: 2px;
}

.ytb-header {
  position: sticky;
  inset-block-start: 0;
  z-index: 300;
  height: var(--ytb-header-h);
  display: flex;
  align-items: center;
  gap: 10px;
  padding-inline: 16px;
  background: color-mix(in srgb, var(--ytb-bg) 96%, transparent);
  backdrop-filter: blur(14px) saturate(150%);
}

.ytb-icon-btn,
.ytb-menu-button {
  width: 40px;
  height: 40px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  transition: background var(--ytb-motion-fast) ease, transform 90ms ease-out, color var(--ytb-motion-fast) ease;
}

.ytb-icon-btn:hover,
.ytb-menu-button:hover { background: var(--ytb-surface); }
.ytb-icon-btn:active,
.ytb-menu-button:active { transform: var(--ytb-press); background: var(--ytb-surface-strong); }

.ytb-logo {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 128px;
  font-family: Roboto, Arial, sans-serif;
  font-size: 21px;
  line-height: 1;
  font-weight: 800;
  letter-spacing: -.045em;
  direction: ltr;
  color: var(--ytb-brand);
  white-space: nowrap;
}
.ytb-logo img { width: auto; height: 28px; object-fit: contain; }

.ytb-search {
  width: min(100%, 640px);
  height: 40px;
  display: flex;
  margin-inline: auto;
  direction: rtl;
}
.ytb-search input {
  min-width: 0;
  flex: 1;
  padding: 0 18px;
  border: 1px solid var(--ytb-border);
  border-radius: 0 var(--ytb-radius-control) var(--ytb-radius-control) 0;
  background: var(--ytb-bg);
  font-size: 16px;
  line-height: 40px;
  outline: 0;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, .04);
}
.ytb-search input:focus {
  border-color: var(--ytb-focus);
  box-shadow: inset 1px 0 0 var(--ytb-focus), inset 0 1px 2px rgba(0, 0, 0, .05);
}
.ytb-search button {
  width: 64px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--ytb-border);
  border-inline-start: 0;
  border-radius: var(--ytb-radius-control) 0 0 var(--ytb-radius-control);
  background: var(--ytb-surface);
}
.ytb-search button:hover { background: var(--ytb-surface-strong); }
.ytb-search button:active { background: var(--ytb-border); }

.ytb-header-actions {
  min-width: 128px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}
.ytb-mobile-search-btn { display: none; }
.ytb-create-btn,
.ytb-login-btn,
.ytb-solid-btn,
.ytb-action-btn,
.ytb-text-btn,
.ytb-subscribe-btn,
.ytb-sort-btn {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 0;
  border-radius: var(--ytb-radius-control);
  white-space: nowrap;
  transition: background var(--ytb-motion-fast) ease, color var(--ytb-motion-fast) ease, transform 90ms ease-out;
}
.ytb-create-btn { padding: 0 14px; background: var(--ytb-surface); font-size: 14px; font-weight: 600; }
.ytb-create-btn:hover { background: var(--ytb-surface-strong); }
.ytb-login-btn { min-height: 38px; padding: 0 14px; border: 1px solid color-mix(in srgb,var(--ytb-focus) 24%,var(--ytb-border)); background: var(--ytb-bg); color: var(--ytb-focus); font-size: 14px; font-weight: 600; }
.ytb-login-btn:hover { background: color-mix(in srgb,var(--ytb-focus) 12%,var(--ytb-bg)); border-color: transparent; }
.ytb-account-link { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; }
.ytb-account-link:active,
.ytb-create-btn:active,
.ytb-login-btn:active,
.ytb-solid-btn:active,
.ytb-action-btn:active,
.ytb-text-btn:active,
.ytb-subscribe-btn:active,
.ytb-sort-btn:active { transform: var(--ytb-press); }

.ytb-avatar {
  display: block;
  flex: 0 0 auto;
  border-radius: 50%;
  object-fit: cover;
  background: var(--ytb-surface-strong);
}
.ytb-avatar-fallback {
  display: inline-grid;
  place-items: center;
  color: #fff;
  background: #272727;
  font-family: Arial, sans-serif;
  font-size: .85rem;
  font-weight: 700;
}

.ytb-layout { min-height: calc(100vh - var(--ytb-header-h)); display: flex; align-items: stretch; }
.ytb-sidebar {
  position: sticky;
  inset-block-start: var(--ytb-header-h);
  width: var(--ytb-sidebar-w);
  height: calc(100vh - var(--ytb-header-h));
  flex: 0 0 var(--ytb-sidebar-w);
  overflow-x: hidden;
  overflow-y: auto;
  padding: 12px;
  scrollbar-width: thin;
  background: var(--ytb-bg);
  transition: width var(--ytb-motion-medium) cubic-bezier(.2, .8, .2, 1), flex-basis var(--ytb-motion-medium) cubic-bezier(.2, .8, .2, 1), transform var(--ytb-motion-medium) cubic-bezier(.2, .8, .2, 1);
}
.ytb-sidebar nav { display: grid; gap: 4px; }
.ytb-sidebar nav a {
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 0 12px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  transition: background var(--ytb-motion-fast) ease, transform 90ms ease-out;
}
.ytb-sidebar nav a:hover { background: var(--ytb-surface); }
.ytb-sidebar nav a.active { background: var(--ytb-surface); font-weight: 700; }
.ytb-sidebar nav a:active { transform: scale(.98); background: var(--ytb-surface-strong); }
.ytb-sidebar-divider { height: 1px; margin: 12px 0; background: var(--ytb-border); }
.ytb-sidebar-login { padding: 8px 12px; }
.ytb-sidebar-login p { max-width: 190px; margin-block-end: 14px; font-size: 14px; line-height: 1.7; }
.ytb-sidebar-scrim { display: none; }

.ytb-sidebar-collapsed:not(.ytb-watch-view) .ytb-sidebar { width: var(--ytb-sidebar-collapsed-w); flex-basis: var(--ytb-sidebar-collapsed-w); padding-inline: 8px; }
.ytb-sidebar-collapsed:not(.ytb-watch-view) .ytb-sidebar nav a { min-height: 58px; flex-direction: column; justify-content: center; gap: 4px; padding: 4px; font-size: 10px; }
.ytb-sidebar-collapsed:not(.ytb-watch-view) .ytb-sidebar-divider,
.ytb-sidebar-collapsed:not(.ytb-watch-view) .ytb-sidebar-login { display: none; }

.ytb-layout.is-watch .ytb-sidebar { display: none; }
.ytb-main { width: 0; min-width: 0; flex: 1 1 auto; padding: 16px 24px 56px; }
.ytb-main-watch { padding: 20px 24px 56px; }
.ytb-main-narrow { padding-block-start: 28px; }

.ytb-chip-rail {
  position: sticky;
  inset-block-start: var(--ytb-header-h);
  z-index: 100;
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 4px 0 16px;
  background: color-mix(in srgb, var(--ytb-bg) 96%, transparent);
  backdrop-filter: blur(12px);
  scrollbar-width: none;
}
.ytb-chip-rail::-webkit-scrollbar { display: none; }
.ytb-chip-rail button {
  min-height: 36px;
  flex: 0 0 auto;
  padding: 0 14px;
  border: 0;
  border-radius: 8px;
  background: var(--ytb-surface);
  font-size: 14px;
  font-weight: 600;
  transition: background var(--ytb-motion-fast) ease, transform 90ms ease-out;
}
.ytb-chip-rail button:hover { background: var(--ytb-surface-strong); }
.ytb-chip-rail button.active { color: var(--ytb-bg); background: var(--ytb-text); }
.ytb-chip-rail button:active { transform: scale(.96); }

.ytb-page-heading { margin: 10px 0 24px; }
.ytb-page-heading h1 { font-size: clamp(22px, 2vw, 28px); line-height: 1.25; font-weight: 700; letter-spacing: -.015em; }
.ytb-page-heading p { margin-block-start: 6px; color: var(--ytb-muted); font-size: 14px; line-height: 1.7; }
.ytb-heading-actions { display: flex; align-items: center; justify-content: space-between; gap: 16px; }

.ytb-grid {
  width: 100%;
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 34px 16px;
}
.ytb-feed, .ytb-card { width: 100%; min-width: 0; }
.ytb-thumb-link { display: block; border-radius: var(--ytb-radius-media); }
.ytb-thumb-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: var(--ytb-radius-media);
  background: var(--ytb-surface-strong);
  transform: translateZ(0);
  transition: transform var(--ytb-motion-fast) cubic-bezier(.2, .8, .2, 1), border-radius var(--ytb-motion-fast) ease;
}
.ytb-thumb-link:active .ytb-thumb-wrap { transform: scale(.985); }
.ytb-thumb,
.ytb-thumb-wrap > img,
.ytb-media-fallback { width: 100%; height: 100%; display: block; object-fit: cover; }
.ytb-media-fallback { display: grid; place-items: center; color: var(--ytb-muted); background: var(--ytb-surface-strong); }
.ytb-duration {
  position: absolute;
  inset-inline-end: 6px;
  inset-block-end: 6px;
  padding: 2px 5px;
  border-radius: 4px;
  color: #fff;
  background: rgba(0, 0, 0, .78);
  font-family: Roboto, Arial, sans-serif;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.25;
  direction: ltr;
}
.ytb-card-body { display: grid; grid-template-columns: 36px minmax(0, 1fr) 32px; gap: 11px; margin-block-start: 12px; align-items: start; }
.ytb-card-avatar { display: block; grid-column: 1; grid-row: 1; padding-block-start: 1px; }
.ytb-card-copy { min-width: 0; grid-column: 2; grid-row: 1; }
.ytb-card-body.no-avatar .ytb-card-copy { grid-column: 1 / 3; }
.ytb-card-title {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  color: var(--ytb-text);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.45;
}
.ytb-card-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; margin-block-start: 3px; color: var(--ytb-muted); font-size: 13px; line-height: 1.45; }
.ytb-channel-link:hover { color: var(--ytb-text); }
.ytb-card-menu { width: 32px; height: 32px; grid-column: 3; grid-row: 1; opacity: 0; }
.ytb-card:hover .ytb-card-menu,
.ytb-card-menu:focus-visible { opacity: 1; }

.ytb-popover {
  position: fixed;
  z-index: 900;
  min-width: 260px;
  padding: 8px;
  border-radius: 12px;
  background: var(--ytb-bg);
  box-shadow: var(--ytb-shadow-menu);
  transform-origin: top right;
  animation: ytb-pop-in var(--ytb-motion-fast) cubic-bezier(.2, .8, .2, 1) both;
}
.ytb-popover button { width: 100%; min-height: 44px; display: flex; align-items: center; gap: 12px; padding: 0 12px; border: 0; border-radius: 8px; background: transparent; text-align: start; font-size: 14px; }
.ytb-popover button:hover { background: var(--ytb-surface); }
@keyframes ytb-pop-in { from { opacity: 0; transform: scale(.96); } }

.ytb-watch-grid {
  width: min(100%, 1840px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) 402px;
  gap: 24px;
  margin: 0 auto;
  align-items: start;
}
.ytb-watch-main { min-width: 0; }
.ytb-player-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: var(--ytb-radius-media);
  color: #fff;
  background: #000;
}
.ytb-player-wrap video { width: 100%; height: 100%; display: block; object-fit: contain; background: #000; }
.ytb-player-wrap .ytb-empty { color: #fff; }
.ytb-player-wrap .ytb-empty p { color: #cfcfcf; }
.ytb-pause-ad { position: absolute; inset: 50% auto auto 50%; z-index: 5; width: min(320px,76%); aspect-ratio: 16/5; opacity: 0; transform: translate(-50%,-50%) scale(.96); transition: opacity 180ms ease,transform 180ms cubic-bezier(.2,.8,.2,1); }
.ytb-pause-ad[hidden] { display: none; }
.ytb-pause-ad.is-visible { opacity: 1; transform: translate(-50%,-50%) scale(1); }
.ytb-pause-ad-link { width: 100%; height: 100%; display: block; overflow: hidden; border: 1px solid rgba(255,255,255,.72); border-radius: 8px; background: #111; box-shadow: 0 10px 34px rgba(0,0,0,.42); }
.ytb-pause-ad-link img { width: 100%; height: 100%; display: block; object-fit: cover; }
.ytb-pause-ad-close { position: absolute; inset: -14px -14px auto auto; width: 32px; height: 32px; color: #fff; background: rgba(0,0,0,.84); box-shadow: 0 2px 10px rgba(0,0,0,.3); }
.ytb-pause-ad-close:hover { background: #000; }
.ytb-video-title { margin: 14px 0 10px; font-size: clamp(18px, 1.45vw, 22px); line-height: 1.45; font-weight: 700; letter-spacing: -.012em; }

.ytb-channel-actions { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-block-end: 14px; }
.ytb-channel-identity { min-width: 0; display: flex; align-items: center; gap: 12px; }
.ytb-channel-avatar-link { display: block; flex: 0 0 auto; }
.ytb-channel-name { display: block; max-width: 180px; overflow: hidden; text-overflow: ellipsis; font-size: 15px; font-weight: 700; white-space: nowrap; }
.ytb-channel-subscribers { display: block; margin-block-start: 2px; color: var(--ytb-muted); font-size: 12px; white-space: nowrap; }
.ytb-subscribe-btn { min-height: 38px; padding: 0 17px; color: var(--ytb-bg); background: var(--ytb-text); font-size: 14px; font-weight: 700; }
.ytb-subscribe-btn:hover { background: color-mix(in srgb,var(--ytb-text) 84%,var(--ytb-bg)); }
.ytb-subscribe-btn.subscribed { color: var(--ytb-text); background: var(--ytb-surface); }
.ytb-subscribe-btn.subscribed:hover { background: var(--ytb-surface-strong); }

.ytb-watch-actions { min-width: 0; display: flex; align-items: center; justify-content: flex-end; gap: 8px; overflow-x: auto; padding-block: 2px; scrollbar-width: none; }
.ytb-watch-actions::-webkit-scrollbar { display: none; }
.ytb-watch-actions-standalone { justify-content: flex-start; margin-block-end: 14px; }
.ytb-action-btn { min-height: 36px; padding: 0 13px; background: var(--ytb-surface); font-size: 14px; font-weight: 600; }
.ytb-action-btn:hover { background: var(--ytb-surface-strong); }
.ytb-action-btn.active { color: var(--ytb-focus); background: color-mix(in srgb,var(--ytb-focus) 14%,var(--ytb-bg)); }
.ytb-reaction-group { display: flex; flex: 0 0 auto; overflow: hidden; border-radius: var(--ytb-radius-control); background: var(--ytb-surface); }
.ytb-reaction-group .ytb-action-btn { border-radius: 0; background: transparent; }
.ytb-reaction-group .ytb-action-btn + .ytb-action-btn { position: relative; }
.ytb-reaction-group .ytb-action-btn + .ytb-action-btn::before { content: ''; position: absolute; inset-block: 8px; inset-inline-start: 0; width: 1px; background: var(--ytb-border); }

.ytb-description { position: relative; padding: 12px 14px; border-radius: 12px; background: var(--ytb-surface); font-size: 14px; line-height: 1.85; }
.ytb-description-meta { display: flex; gap: 7px; margin-block-end: 5px; font-size: 13px; font-weight: 700; }
.ytb-description-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.ytb-description.is-collapsed .ytb-description-text { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }
.ytb-description-toggle { min-height: 28px; margin-block-start: 4px; padding: 0; border: 0; background: transparent; font-size: 13px; font-weight: 700; }

.ytb-watch-side { min-width: 0; }
.ytb-watch-side > h2 { margin: 2px 0 12px; font-size: 17px; line-height: 1.4; }
.ytb-related-card { position: relative; display: grid; grid-template-columns: 168px minmax(0, 1fr) 28px; gap: 8px; margin-block-end: 10px; align-items: start; }
.ytb-related-thumb { position: relative; display: block; aspect-ratio: 16 / 9; overflow: hidden; border-radius: 8px; background: var(--ytb-surface-strong); transition: transform var(--ytb-motion-fast) ease; }
.ytb-related-thumb:active { transform: scale(.985); }
.ytb-related-thumb img,
.ytb-related-thumb > .ytb-media-fallback { width: 100%; height: 100%; object-fit: cover; }
.ytb-related-title { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; font-size: 14px; line-height: 1.45; font-weight: 700; }
.ytb-related-copy .ytb-card-meta { font-size: 12px; }
.ytb-related-menu { width: 28px; height: 28px; }

.ytb-comments { margin-block-start: 24px; }
.ytb-comments-heading { display: flex; align-items: center; gap: 26px; margin-block-end: 22px; }
.ytb-comments-heading h2 { font-size: 18px; line-height: 1.4; }
.ytb-sort-btn { padding: 0 4px; background: transparent; font-size: 14px; font-weight: 700; }
.ytb-sort-btn:hover { color: var(--ytb-focus); }
.ytb-comment-login { min-height: 54px; display: flex; align-items: center; gap: 14px; margin-block-end: 20px; padding: 8px 12px; border: 1px solid var(--ytb-border); border-radius: 10px; font-size: 14px; }
.ytb-comment-login .ytb-login-btn { margin-inline-start: auto; }
.ytb-comment-composer { display: flex; align-items: flex-start; gap: 12px; margin-block-end: 24px; }
.ytb-comment-input-wrap { min-width: 0; flex: 1; }
.ytb-comment-input-wrap textarea { width: 100%; min-height: 36px; display: block; resize: none; overflow: hidden; padding: 7px 2px; border: 0; border-block-end: 1px solid #909090; outline: 0; background: transparent; font-size: 14px; line-height: 1.6; }
.ytb-comment-input-wrap textarea:focus { border-block-end: 2px solid var(--ytb-text); }
.ytb-comment-compose-actions { display: none; justify-content: flex-end; gap: 8px; margin-block-start: 8px; }
.ytb-comment-compose-actions.is-visible { display: flex; }
.ytb-text-btn { min-height: 36px; padding: 0 14px; background: transparent; font-size: 14px; font-weight: 700; }
.ytb-text-btn:hover { background: var(--ytb-surface); }
.ytb-solid-btn { min-height: 38px; padding: 0 18px; color: var(--ytb-bg); background: var(--ytb-text); font-size: 14px; font-weight: 700; }
.ytb-solid-btn:hover { background: color-mix(in srgb,var(--ytb-text) 84%,var(--ytb-bg)); }
.ytb-comment { display: flex; align-items: flex-start; gap: 12px; margin-block-end: 22px; }
.ytb-comment-body { min-width: 0; flex: 1; }
.ytb-comment-author { display: flex; align-items: baseline; gap: 8px; margin-block-end: 4px; }
.ytb-comment-author strong { font-size: 13px; }
.ytb-comment-author span { color: var(--ytb-muted); font-size: 12px; }
.ytb-comment-body > p { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; line-height: 1.75; }
.ytb-comment-controls { display: flex; align-items: center; gap: 5px; margin-block-start: 3px; }
.ytb-comment-controls .ytb-action-btn { min-height: 32px; padding: 0 8px; background: transparent; }
.ytb-comment-controls .ytb-action-btn span { display: inline; }
.ytb-comment-controls .ytb-action-btn span:empty { display: none; }
.ytb-comment-reply-btn,
.ytb-comment-delete { min-height: 32px; display: inline-flex; align-items: center; gap: 5px; padding: 0 8px; border: 0; border-radius: var(--ytb-radius-control); background: transparent; font-size: 12px; font-weight: 700; }
.ytb-comment-reply-btn:hover,
.ytb-comment-delete:hover { background: var(--ytb-surface); }
.ytb-comment-delete { color: #b00020; }
.ytb-comment.is-reply { margin-block: 14px 0; }
.ytb-comment-replies { margin-block-start: 10px; padding-inline-start: 4px; }
.ytb-reply-host { margin-block-start: 10px; }
.ytb-comment-loading { padding: 24px 0; color: var(--ytb-muted); font-size: 14px; }

.ytb-channel-cover { width: 100%; max-height: 260px; aspect-ratio: 16 / 3; display: block; object-fit: cover; border-radius: 14px; }
.ytb-channel-header { display: flex; align-items: center; gap: 24px; padding: 28px 24px; }
.ytb-channel-header > .ytb-avatar { width: 120px !important; height: 120px !important; }
.ytb-channel-copy { min-width: 0; flex: 1; }
.ytb-channel-copy h1 { font-size: 28px; line-height: 1.25; }
.ytb-channel-copy p { max-width: 780px; display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; margin-block-start: 8px; color: var(--ytb-muted); font-size: 14px; line-height: 1.7; }
.ytb-channel-tabs { display: flex; min-height: 48px; align-items: flex-end; margin-block-end: 24px; border-block-end: 1px solid var(--ytb-border); }
.ytb-channel-tabs span { min-width: 92px; padding: 0 16px 13px; text-align: center; font-size: 14px; font-weight: 700; }
.ytb-channel-tabs span.active { border-block-end: 2px solid var(--ytb-text); }
.ytb-channel-list { display: grid; gap: 12px; }
.ytb-channel-list-item { display: flex; align-items: center; gap: 18px; padding: 12px; border-radius: 12px; }
.ytb-channel-list-item:hover { background: var(--ytb-surface); }
.ytb-channel-list-item h2 { font-size: 18px; }
.ytb-channel-list-item p { margin-block-start: 4px; color: var(--ytb-muted); font-size: 13px; }

.ytb-upload-page { width: min(100%, 960px); margin-inline: auto; }
.ytb-form { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; padding: 28px; border: 1px solid var(--ytb-border); border-radius: 14px; }
.ytb-form-section { min-width: 0; }
.ytb-form-section h2 { margin-block-end: 18px; font-size: 18px; }
.ytb-field-label { display: block; margin-block-end: 16px; font-size: 13px; font-weight: 600; }
.ytb-field-label > span { display: block; margin-block-end: 7px; }
.ytb-field-label small { display: block; margin-block-start: 6px; color: var(--ytb-muted); font-size: 11px; font-weight: 400; line-height: 1.6; }
.ytb-field-label input,
.ytb-field-label textarea,
.ytb-field-label select {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--ytb-border);
  border-radius: 8px;
  outline: 0;
  background: var(--ytb-bg);
  font-size: 14px;
  line-height: 1.55;
}
.ytb-field-label textarea { resize: vertical; }
.ytb-field-label input[type='file'] { padding: 8px; }
.ytb-native-file-input { display: none !important; }
.ytb-file-control { min-height: 46px; display: flex; align-items: center; gap: 12px; padding: 5px; border: 1px solid var(--ytb-border); border-radius: 8px; background: var(--ytb-bg); }
.ytb-file-button { min-height: 36px; flex: 0 0 auto; padding: 0 13px; border: 0; border-radius: 6px; background: var(--ytb-surface); color: var(--ytb-text); font-size: 13px; font-weight: 600; }
.ytb-file-button:hover { background: var(--ytb-surface-strong); }
.ytb-file-name { min-width: 0; overflow: hidden; color: var(--ytb-muted); text-overflow: ellipsis; white-space: nowrap; font-size: 12px; font-weight: 400; }
.ytb-field-label input:focus,
.ytb-field-label textarea:focus,
.ytb-field-label select:focus { border-color: var(--ytb-focus); box-shadow: 0 0 0 1px var(--ytb-focus); }
.ytb-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ytb-form-message { min-height: 22px; color: #b00020; font-size: 13px; line-height: 1.6; }
.ytb-upload-progress { display: none; grid-column: 1 / -1; gap: 8px; color: var(--ytb-muted); font-size: 12px; }
.ytb-upload-progress.is-visible { display: grid; }
.ytb-progress-track { height: 5px; overflow: hidden; border-radius: var(--ytb-radius-control); background: var(--ytb-surface-strong); direction: ltr; }
.ytb-progress-bar { width: 0; height: 100%; border-radius: inherit; background: var(--ytb-brand); transition: width 160ms linear; }
.ytb-upload-submit { grid-column: 1 / -1; justify-self: end; }

.ytb-studio { width: min(100%, 1200px); margin-inline: auto; }
.ytb-studio-list { border-block-start: 1px solid var(--ytb-border); }
.ytb-studio-row { display: grid; grid-template-columns: 200px minmax(0, 1fr) auto; gap: 18px; align-items: center; padding: 16px 0; border-block-end: 1px solid var(--ytb-border); }
.ytb-studio-thumb { position: relative; aspect-ratio: 16 / 9; overflow: hidden; border-radius: 8px; background: var(--ytb-surface); }
.ytb-studio-thumb img,
.ytb-studio-thumb .ytb-media-fallback { width: 100%; height: 100%; object-fit: cover; }
.ytb-studio-copy h3 { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; font-size: 15px; line-height: 1.5; }
.ytb-studio-copy p { margin-block-start: 5px; color: var(--ytb-muted); font-size: 12px; }
.ytb-visibility { display: inline-block; margin-block-start: 7px; padding: 3px 8px; border-radius: 6px; background: var(--ytb-surface); font-size: 11px; }
.ytb-studio-actions { display: flex; gap: 8px; }
.ytb-danger-btn { color: #b00020; }
.ytb-edit-modal { min-width: min(560px, 84vw); }

.ytb-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 20px;
  visibility: hidden;
  opacity: 0;
  background: rgba(0, 0, 0, .62);
  transition: opacity var(--ytb-motion-medium) ease, visibility var(--ytb-motion-medium) step-end;
}
.ytb-modal-backdrop.is-visible { visibility: visible; opacity: 1; transition: opacity var(--ytb-motion-medium) ease; }
.ytb-modal {
  position: relative;
  width: min(100%, 430px);
  max-height: min(90vh, 760px);
  overflow-y: auto;
  padding: 28px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--ytb-bg) 98%, transparent);
  box-shadow: 0 20px 70px rgba(0, 0, 0, .28);
  transform: scale(.96) translateY(8px);
  filter: blur(3px);
  transform-origin: center;
  transition: transform var(--ytb-motion-medium) cubic-bezier(.2, .8, .2, 1), filter var(--ytb-motion-medium) ease;
}
.ytb-modal-backdrop.is-visible .ytb-modal { transform: scale(1) translateY(0); filter: blur(0); }
.ytb-modal-close { position: absolute; inset-block-start: 10px; inset-inline-end: 10px; }
.ytb-modal-content h2 { padding-inline-end: 34px; font-size: 22px; line-height: 1.4; }
.ytb-modal-content > p:not(.ytb-form-message) { margin: 10px 0 22px; color: var(--ytb-muted); font-size: 14px; line-height: 1.8; }
.ytb-modal-content > .ytb-solid-btn { width: 100%; margin-block-start: 6px; }
.ytb-modal-content > .ytb-text-btn { width: 100%; margin-block-start: 8px; }
.ytb-confirm-content > p { margin-block-end: 20px !important; }
.ytb-confirm-actions { display: flex; justify-content: flex-end; gap: 8px; }
.ytb-confirm-actions .ytb-solid-btn,
.ytb-confirm-actions .ytb-text-btn { width: auto; margin: 0; }
.ytb-confirm-danger { background: #b00020; }
.ytb-confirm-danger:hover { background: #8e001a; }

.ytb-toast-region { position: fixed; inset-inline-start: 22px; inset-block-end: 22px; z-index: 1200; display: grid; gap: 8px; pointer-events: none; }
.ytb-toast { max-width: min(420px, calc(100vw - 44px)); padding: 12px 18px; border-radius: 6px; color: #fff; background: #272727; box-shadow: 0 8px 24px rgba(0, 0, 0, .2); opacity: 0; transform: translateY(8px); transition: opacity 180ms ease, transform 180ms cubic-bezier(.2, .8, .2, 1); font-size: 13px; }
.ytb-toast.is-visible { opacity: 1; transform: translateY(0); }
.ytb-clipboard-helper { position: fixed; inset-inline-start: -9999px; }

.ytb-empty { width: min(100%, 520px); min-height: 260px; display: flex; flex-direction: column; align-items: center; justify-content: center; margin: 20px auto; padding: 28px; text-align: center; }
.ytb-empty-icon { width: 68px; height: 68px; display: grid; place-items: center; margin-block-end: 16px; border-radius: 50%; color: var(--ytb-muted); background: var(--ytb-surface); }
.ytb-empty h2 { font-size: 19px; line-height: 1.4; }
.ytb-empty p { margin: 8px 0 18px; color: var(--ytb-muted); font-size: 14px; line-height: 1.75; }

.ytb-skeleton-thumb,
.ytb-skeleton-body span,
.ytb-skeleton-body i,
.ytb-related-skeleton > span,
.ytb-related-skeleton i,
.ytb-player-skeleton {
  display: block;
  background: var(--ytb-surface-strong);
  animation: ytb-pulse 1.1s ease-in-out infinite alternate;
}
.ytb-skeleton-thumb { aspect-ratio: 16 / 9; border-radius: var(--ytb-radius-media); }
.ytb-skeleton-body { display: grid; grid-template-columns: 36px 1fr; gap: 11px; margin-block-start: 12px; }
.ytb-skeleton-body span { width: 36px; height: 36px; border-radius: 50%; }
.ytb-skeleton-body div { display: grid; gap: 7px; padding-block-start: 2px; }
.ytb-skeleton-body i { height: 11px; border-radius: 4px; }
.ytb-skeleton-body i:nth-child(2) { width: 80%; }
.ytb-skeleton-body i:nth-child(3) { width: 54%; }
.ytb-related-skeleton { display: grid; grid-template-columns: 168px 1fr; gap: 8px; margin-block-end: 10px; }
.ytb-related-skeleton > span { aspect-ratio: 16 / 9; border-radius: 8px; }
.ytb-related-skeleton div { display: grid; align-content: start; gap: 7px; padding-block-start: 2px; }
.ytb-related-skeleton i { height: 10px; border-radius: 4px; }
.ytb-related-skeleton i:nth-child(2) { width: 75%; }
.ytb-related-skeleton i:nth-child(3) { width: 50%; }
.ytb-player-skeleton { width: min(100%, 1200px); aspect-ratio: 16 / 9; margin-inline-start: auto; border-radius: var(--ytb-radius-media); background: var(--ytb-surface-strong); }
@keyframes ytb-pulse { to { opacity: .48; } }

@media (min-width: 2100px) {
  .ytb-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}

@media (max-width: 1500px) {
  .ytb-watch-grid { grid-template-columns: minmax(0, 1fr) 360px; gap: 20px; }
  .ytb-related-card { grid-template-columns: 150px minmax(0, 1fr) 26px; }
}

@media (max-width: 1360px) {
  .ytb-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .ytb-channel-actions { align-items: flex-start; flex-direction: column; }
  .ytb-watch-actions { width: 100%; justify-content: flex-start; }
}

@media (max-width: 1120px) {
  .ytb-watch-grid { grid-template-columns: minmax(0, 1fr); }
  .ytb-watch-side { margin-block-start: 12px; }
  #ytb-related { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 18px; }
  .ytb-related-card { grid-template-columns: 168px minmax(0, 1fr) 28px; margin: 0; }
  .ytb-form { grid-template-columns: 1fr; }
  .ytb-upload-progress,
  .ytb-upload-submit { grid-column: 1; }
}

@media (max-width: 960px) {
  :root { --ytb-header-h: 56px; }
  .ytb-header { padding-inline: 10px; }
  .ytb-logo { min-width: 0; font-size: 19px; }
  .ytb-header-actions { min-width: 0; margin-inline-start: auto; }
  .ytb-create-btn span { display: none; }
  .ytb-create-btn { width: 40px; height: 40px; padding: 0; border-radius: 50%; }
  .ytb-sidebar,
  .ytb-sidebar-collapsed:not(.ytb-watch-view) .ytb-sidebar {
    position: fixed;
    inset: var(--ytb-header-h) 0 0 auto;
    z-index: 700;
    display: block;
    width: min(280px, 86vw);
    height: calc(100vh - var(--ytb-header-h));
    padding: 12px;
    transform: translateX(105%);
    box-shadow: -10px 0 30px rgba(0, 0, 0, .14);
  }
  .ytb-sidebar-collapsed:not(.ytb-watch-view) .ytb-sidebar nav a,
  .ytb-sidebar nav a { min-height: 44px; flex-direction: row; justify-content: flex-start; gap: 24px; padding: 0 12px; font-size: 14px; }
  .ytb-sidebar-collapsed:not(.ytb-watch-view) .ytb-sidebar-divider,
  .ytb-sidebar-collapsed:not(.ytb-watch-view) .ytb-sidebar-login { display: block; }
  .ytb-sidebar-open .ytb-sidebar { transform: translateX(0); }
  .ytb-sidebar-scrim { position: fixed; inset: var(--ytb-header-h) 0 0; z-index: 650; display: block; visibility: hidden; border: 0; opacity: 0; background: rgba(0, 0, 0, .5); transition: opacity var(--ytb-motion-medium) ease, visibility var(--ytb-motion-medium) step-end; }
  .ytb-sidebar-open .ytb-sidebar-scrim { visibility: visible; opacity: 1; transition: opacity var(--ytb-motion-medium) ease; }
  .ytb-main { padding-inline: 16px; }
  .ytb-card-menu { opacity: 1; }
}

@media (max-width: 780px) {
  .ytb-search { display: none; position: absolute; inset: 8px 8px 8px 52px; z-index: 10; width: auto; height: 40px; background: var(--ytb-bg); }
  .ytb-search-open .ytb-search { display: flex; }
  .ytb-mobile-search-btn { display: inline-grid; }
  .ytb-header-actions .ytb-login-btn span { display: none; }
  .ytb-header-actions .ytb-login-btn { width: 40px; padding: 0; border: 0; }
  .ytb-header .ytb-icon-btn,
  .ytb-header .ytb-menu-button,
  .ytb-header .ytb-login-btn,
  .ytb-header .ytb-create-btn,
  .ytb-header .ytb-account-link { width: 44px; height: 44px; min-height: 44px; }
  .ytb-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap-block: 26px; }
  .ytb-card-body { grid-template-columns: 32px minmax(0, 1fr) 28px; gap: 9px; }
  .ytb-card-avatar .ytb-avatar { width: 32px !important; height: 32px !important; }
  .ytb-card-title { font-size: 14px; }
  .ytb-card-meta { font-size: 12px; }
  #ytb-related { grid-template-columns: 1fr; }
  .ytb-channel-header { align-items: flex-start; flex-wrap: wrap; padding-inline: 8px; }
  .ytb-channel-header > .ytb-avatar { width: 88px !important; height: 88px !important; }
  .ytb-channel-copy { flex-basis: calc(100% - 120px); }
  .ytb-channel-copy h1 { font-size: 22px; }
  .ytb-channel-header > .ytb-subscribe-btn { margin-inline-start: 112px; }
  .ytb-form { padding: 18px; }
  .ytb-studio-row { grid-template-columns: 150px minmax(0, 1fr); }
  .ytb-studio-actions { grid-column: 1 / -1; justify-content: flex-end; }
}

@media (max-width: 600px) {
  .ytb-main { padding: 10px 12px 42px; }
  .ytb-main-watch { padding-block-start: 0; }
  .ytb-chip-rail { margin-inline: -12px; padding: 6px 12px 12px; }
  .ytb-grid { grid-template-columns: 1fr; gap: 28px; }
  .ytb-thumb-wrap { border-radius: 10px; }
  .ytb-player-wrap { width: calc(100% + 24px); margin-inline: -12px; border-radius: 0; }
  .ytb-video-title { margin-block-start: 12px; font-size: 18px; }
  .ytb-channel-actions { gap: 12px; }
  .ytb-channel-identity { width: 100%; }
  .ytb-channel-identity > .ytb-subscribe-btn { margin-inline-start: auto; }
  .ytb-watch-actions { margin-inline: -12px; width: calc(100% + 24px); padding-inline: 12px; }
  .ytb-action-btn { min-height: 44px; }
  .ytb-reaction-group .ytb-action-btn { min-height: 44px; }
  .ytb-watch-actions > .ytb-icon-btn { width: 44px; height: 44px; background: var(--ytb-surface); }
  .ytb-description { padding: 12px; }
  .ytb-comments { margin-block-start: 22px; }
  .ytb-comments-heading { margin-block-end: 16px; }
  .ytb-comment-login { align-items: flex-start; flex-direction: column; }
  .ytb-comment-login .ytb-login-btn { margin-inline-start: 0; }
  .ytb-watch-side > h2 { margin-block-start: 12px; }
  .ytb-related-card { grid-template-columns: 44% minmax(0, 1fr) 24px; gap: 9px; }
  .ytb-related-title { font-size: 13px; }
  .ytb-channel-cover { margin-inline: -12px; width: calc(100% + 24px); border-radius: 0; }
  .ytb-channel-header { gap: 14px; }
  .ytb-channel-header > .ytb-avatar { width: 72px !important; height: 72px !important; }
  .ytb-channel-copy { flex-basis: calc(100% - 90px); }
  .ytb-channel-header > .ytb-subscribe-btn { margin-inline-start: 86px; }
  .ytb-page-heading { margin-block-start: 4px; }
  .ytb-heading-actions { align-items: flex-start; }
  .ytb-heading-actions .ytb-solid-btn { padding-inline: 13px; }
  .ytb-form-row { grid-template-columns: 1fr; gap: 0; }
  .ytb-form { border: 0; padding: 0; }
  .ytb-studio-row { grid-template-columns: 120px minmax(0, 1fr); gap: 12px; }
  .ytb-studio-actions { justify-content: stretch; }
  .ytb-studio-actions .ytb-action-btn { flex: 1; }
  .ytb-modal { padding: 24px 20px; }
  .ytb-toast-region { inset-inline: 12px; inset-block-end: 12px; }
  .ytb-toast { max-width: none; width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; transition-duration: .01ms !important; }
  .ytb-modal { transform: none; filter: none; }
}

@media (prefers-reduced-transparency: reduce) {
  .ytb-header,
  .ytb-chip-rail,
  .ytb-modal { background: var(--ytb-bg); backdrop-filter: none; }
}

@media (prefers-contrast: more) {
  :root { --ytb-border: #6b6b6b; --ytb-muted: #333; }
  .ytb-header { border-block-end: 1px solid var(--ytb-border); }
  .ytb-action-btn,
  .ytb-chip-rail button { border: 1px solid var(--ytb-border); }
}
