/* bebrainer.com/youtube (5 Dec 2026): the YouTube hub. Builds on the glass theme (theme-base / theme-parts / pages.css)
   and the 4 Dec look (green brand, one yellow main action per page). Phone first; no fixed colours except the yellow
   main action and the red "live" dot, so the dark theme keeps working. No coloured side stripes on cards. */

.yt { --yt-yellow: #facc15; --yt-yellow-ink: #3b2f00; --yt-red: #dc2626; }
.yt .g-panel { margin-bottom: 0; }

/* The one main action of a page */
.yt-main { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 50px; padding: 0 20px; border: 0;
  border-radius: 16px; background: var(--yt-yellow); color: var(--yt-yellow-ink); font: inherit; font-size: 17px; font-weight: 700; cursor: pointer; text-align: center; }
.yt-main:hover { filter: brightness(1.04); color: var(--yt-yellow-ink); }
.yt-main svg { width: 20px; height: 20px; flex: none; }

/* Top strip: channel, numbers, subscribe */
.yt-top { display: flex; flex-direction: column; gap: 12px; }
.yt-chan { display: flex; align-items: center; gap: 12px; }
.yt-chan img { width: 56px; height: 56px; border-radius: 50%; flex: none; background: var(--g-tile); }
.yt-chan h1 { margin: 0; font-size: 22px; line-height: 1.25; }
.yt-chan p { margin: 2px 0 0; font-size: 15px; color: var(--g-muted); }
.yt-nums { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 15px; color: var(--g-muted); }
.yt-nums b { color: var(--g-text); font-size: 16px; }
.yt-sub-btn { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--g-tile-line);
  background: var(--g-tile); color: var(--g-text); font-size: 15px; font-weight: 700; white-space: nowrap; }
.yt-sub-btn i { width: 10px; height: 10px; border-radius: 50%; background: var(--yt-red); }
@media (min-width: 768px) {
  .yt-top { flex-direction: row; align-items: center; justify-content: space-between; }
  .yt-chan h1 { font-size: 28px; }
}

/* Search */
.yt-find { position: relative; display: flex; gap: 8px; }
.yt-find input { flex: 1; min-width: 0; min-height: 52px; padding: 0 46px 0 16px; border-radius: 16px; border: 1px solid var(--g-line);
  background: var(--g-field, var(--g-tile)); color: var(--g-text); font: inherit; font-size: 17px; -webkit-appearance: none; appearance: none; }
.yt-find input:focus { outline: none; border-color: var(--yt-yellow); box-shadow: 0 0 0 3px rgba(250, 204, 21, .3); }
.yt-find .yt-mic { position: absolute; right: 118px; top: 6px; width: 40px; height: 40px; border: 0; border-radius: 50%; background: transparent; color: var(--g-muted); cursor: pointer; display: none; }
.yt-find.has-mic .yt-mic { display: block; }
.yt-find .yt-mic.on { color: var(--yt-red); }
.yt-find .yt-mic svg { width: 22px; height: 22px; }
.yt-find .yt-main { flex: none; min-width: 102px; }
.yt-sugg { position: absolute; left: 0; right: 0; top: 58px; z-index: 30; display: none; flex-direction: column; padding: 6px; border-radius: 14px;
  background: var(--g-panel); border: 1px solid var(--g-panel-line); box-shadow: 0 14px 30px rgba(0, 0, 0, .16); }
.yt-sugg.open { display: flex; }
.yt-sugg a { display: flex; gap: 10px; align-items: center; padding: 6px; border-radius: 10px; color: var(--g-text); font-size: 15px; line-height: 1.35; }
.yt-sugg a:hover, .yt-sugg a.on { background: var(--g-tile-hover); }
.yt-sugg img { width: 64px; height: 36px; object-fit: cover; border-radius: 6px; flex: none; }

/* Chips */
.yt-chips { display: flex; gap: 8px; overflow-x: auto; margin: 0 -12px; padding: 2px 12px 6px; scrollbar-width: none; }
.yt-chips::-webkit-scrollbar { display: none; }
.yt-chips a { flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 42px; padding: 0 14px; border-radius: 999px;
  background: var(--g-tile); border: 1px solid var(--g-tile-line); color: var(--g-text); font-size: 15px; font-weight: 700; white-space: nowrap; }
.yt-chips a.on { background: var(--bb-primary, #15803d); border-color: var(--bb-primary, #15803d); color: #fff; }
.yt-chips a small { font-weight: 400; opacity: .75; }
.yt-chips--sub a { min-height: 38px; font-weight: 500; font-size: 14px; }

/* Rows that swipe on phones */
.yt-row-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 0 0 10px; }
.yt-row-head h2 { margin: 0; font-size: 20px; line-height: 1.3; }
.yt-row-head p { margin: 2px 0 0; font-size: 14px; color: var(--g-muted); }
.yt-row-head a { flex: none; font-size: 15px; font-weight: 700; color: var(--bb-primary, var(--g-accent)); min-height: 40px; display: inline-flex; align-items: center; }
.yt-swipe { display: flex; gap: 12px; overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory; margin: 0 -12px; padding: 2px 12px 8px; scrollbar-width: none; }
.yt-swipe::-webkit-scrollbar { display: none; }
.yt-swipe > * { flex: 0 0 232px; width: 232px; scroll-snap-align: start; }
.yt-swipe--shorts > * { flex-basis: 140px; width: 140px; }
@media (min-width: 768px) { .yt-swipe { margin: 0; padding: 2px 0 8px; } .yt-swipe > * { flex-basis: 260px; width: 260px; } }

/* Grids */
.yt-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 768px) { .yt-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; } }
@media (min-width: 1100px) { .yt-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 359px) { .yt-grid { grid-template-columns: 1fr; } }

/* A video card */
.yt-card { display: flex; flex-direction: column; gap: 6px; color: var(--g-text); min-width: 0; }
.yt-thumb { position: relative; display: block; aspect-ratio: 16 / 9; border-radius: 12px; overflow: hidden; background: var(--g-tile); }
.yt-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.yt-thumb .len { position: absolute; right: 6px; bottom: 6px; padding: 1px 6px; border-radius: 6px; background: rgba(0, 0, 0, .78); color: #fff; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.yt-thumb .bar { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: rgba(255, 255, 255, .35); }
.yt-thumb .bar i { display: block; height: 100%; background: var(--yt-red); }
.yt-thumb .done { position: absolute; left: 6px; top: 6px; padding: 1px 8px; border-radius: 999px; background: #15803d; color: #fff; font-size: 12.5px; font-weight: 700; }
.yt-card b { font-size: 15.5px; line-height: 1.4; font-weight: 600; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.yt-card small { font-size: 13.5px; color: var(--g-muted); line-height: 1.4; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.yt-card--short .yt-thumb { aspect-ratio: 9 / 16; }

/* A playlist card: the stack look comes from a second layer behind the picture */
.yt-pl .yt-thumb { box-shadow: 0 -5px 0 -2px var(--g-tile-line); margin-top: 5px; }
.yt-pl .count { position: absolute; right: 0; top: 0; bottom: 0; width: 38%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  background: rgba(0, 0, 0, .72); color: #fff; font-size: 13px; text-align: center; }
.yt-pl .count strong { font-size: 18px; }
.yt-pl .count svg { width: 22px; height: 22px; }

/* Teachers */
.yt-teach { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; color: var(--g-text); }
.yt-teach img { width: 76px; height: 76px; border-radius: 50%; object-fit: cover; background: var(--g-tile); border: 2px solid var(--g-tile-line); }
.yt-teach b { font-size: 15px; line-height: 1.3; }
.yt-teach small { font-size: 13px; color: var(--g-muted); }
.yt-swipe--teach > * { flex-basis: 104px; width: 104px; }

/* The promotion strip: one at a time */
.yt-promo { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 16px; background: var(--g-tile); border: 1px solid var(--g-tile-line); color: var(--g-text); }
.yt-promo .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--yt-red); flex: none; animation: yt-pulse 1.6s infinite; }
.yt-promo div { flex: 1; min-width: 0; font-size: 15.5px; line-height: 1.45; }
.yt-promo div b { display: block; font-size: 16.5px; }
.yt-promo .go { flex: none; font-weight: 700; color: var(--bb-primary, var(--g-accent)); }
@keyframes yt-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
html.bb-lite .yt-promo .dot { animation: none; }

/* Watch page */
.yt-watch { display: grid; gap: 14px; }
@media (min-width: 1024px) { .yt-watch { grid-template-columns: minmax(0, 1fr) 360px; align-items: start; } }
.yt-player { position: relative; aspect-ratio: 16 / 9; border-radius: 14px; overflow: hidden; background: #000; }
.yt-player img, .yt-player iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; object-fit: cover; }
.yt-player button { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: transparent; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.yt-player button span { width: 76px; height: 54px; border-radius: 14px; background: rgba(220, 38, 38, .95); display: flex; align-items: center; justify-content: center; }
.yt-player button svg { width: 30px; height: 30px; fill: #fff; }
.yt-player .resume { position: absolute; left: 10px; bottom: 10px; padding: 4px 10px; border-radius: 999px; background: rgba(0, 0, 0, .75); color: #fff; font-size: 14px; }
@media (max-width: 767px) { .yt-player { border-radius: 0; margin: 0 -12px; } }
.yt-title { margin: 0; font-size: 20px; line-height: 1.4; overflow-wrap: anywhere; }
@media (min-width: 1024px) { .yt-title { font-size: 24px; } }
.yt-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; font-size: 14.5px; color: var(--g-muted); }
.yt-meta a { color: var(--g-text); font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }
.yt-meta img { width: 28px; height: 28px; border-radius: 50%; }
.yt-nav { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.yt-nav a, .yt-nav span { display: flex; align-items: center; justify-content: center; gap: 4px; min-height: 46px; padding: 0 8px; border-radius: 14px;
  background: var(--g-tile); border: 1px solid var(--g-tile-line); color: var(--g-text); font-size: 15px; font-weight: 600; text-align: center; line-height: 1.2; }
.yt-nav span { opacity: .45; }
.yt-acts { display: grid; gap: 8px; }
.yt-acts .yt-main { width: 100%; }
.yt-quiet { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.yt-quiet a, .yt-quiet button { display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 46px; padding: 0 10px; border-radius: 14px;
  border: 1px solid var(--g-tile-line); background: var(--g-tile); color: var(--g-text); font: inherit; font-size: 15px; font-weight: 600; cursor: pointer; text-align: center; line-height: 1.25; }
.yt-quiet svg { width: 18px; height: 18px; flex: none; }
.yt-desc { font-size: 15px; line-height: 1.6; white-space: pre-line; overflow-wrap: anywhere; max-height: 7.2em; overflow: hidden; position: relative; }
.yt-desc.open { max-height: none; }
.yt-more-btn { border: 0; background: none; padding: 4px 0; color: var(--bb-primary, var(--g-accent)); font: inherit; font-weight: 700; cursor: pointer; }
.yt-side { display: flex; flex-direction: column; gap: 10px; }
.yt-mini { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 10px; color: var(--g-text); }
.yt-mini b { font-size: 14.5px; line-height: 1.4; font-weight: 600; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.yt-mini small { display: block; font-size: 13px; color: var(--g-muted); margin-top: 2px; }
.yt-mini.now { opacity: .55; }

/* Rating card, shown near the end of a class */
.yt-rate { display: none; flex-direction: column; gap: 10px; padding: 14px; border-radius: 16px; background: var(--g-tile); border: 1px solid var(--g-tile-line); }
.yt-rate.open { display: flex; }
.yt-rate p { margin: 0; font-size: 16px; font-weight: 600; }
.yt-stars { display: flex; gap: 6px; }
.yt-stars button { width: 48px; height: 48px; border: 1px solid var(--g-tile-line); border-radius: 12px; background: var(--g-panel); cursor: pointer; font-size: 24px; line-height: 1; color: #d4a106; }
.yt-stars button.on { background: var(--yt-yellow); color: var(--yt-yellow-ink); }
.yt-stars-hint { font-size: 13.5px; color: var(--g-muted); margin: 0; }

/* Login nudge (not a pop-up): a calm line */
.yt-nudge { display: none; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 14px; background: var(--g-tile); border: 1px solid var(--g-tile-line); font-size: 15px; }
.yt-nudge.open { display: flex; }
.yt-nudge a { flex: none; font-weight: 700; color: var(--bb-primary, var(--g-accent)); }

/* Playlist page */
.yt-plhead { display: grid; gap: 12px; }
@media (min-width: 768px) { .yt-plhead { grid-template-columns: 320px minmax(0, 1fr); align-items: center; } }
.yt-plhead h1 { margin: 0; font-size: 22px; line-height: 1.35; }
.yt-list { display: flex; flex-direction: column; gap: 10px; }
.yt-list .yt-mini { grid-template-columns: 28px 150px minmax(0, 1fr); align-items: center; }
.yt-list .n { font-size: 14px; color: var(--g-muted); text-align: center; font-variant-numeric: tabular-nums; }

/* Filters on the list pages */
.yt-tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.yt-tools select { min-height: 42px; padding: 0 10px; border-radius: 12px; border: 1px solid var(--g-tile-line); background: var(--g-tile); color: var(--g-text); font: inherit; font-size: 15px; }
.yt-count { font-size: 14.5px; color: var(--g-muted); margin: 0 0 10px; }
.yt-empty { padding: 22px 14px; text-align: center; font-size: 16px; color: var(--g-muted); }
.yt-pages { display: flex; justify-content: center; gap: 8px; margin-top: 14px; }
.yt-pages a, .yt-pages span { min-height: 44px; min-width: 44px; padding: 0 14px; display: inline-flex; align-items: center; justify-content: center; border-radius: 12px;
  background: var(--g-tile); border: 1px solid var(--g-tile-line); color: var(--g-text); font-weight: 600; }
.yt-pages span { opacity: .5; }

.yt-disclaimer { font-size: 13px; color: var(--g-muted); margin: 8px 0 0; }
