/* Раздел «YouTube»: аккаунт, лента, вход в Google.
   Источники — docs/redesign/canvas/body_YouTube.html, body_YouTubeEmpty.html,
   body_SignIn.html. Владелец — блок D. */

.yt-pane { position: relative; }

/* ---- Слоты аккаунта/ленты (см. _sec_youtube.html) ---- */
#yt-account-slot { flex: none; }
#yt-account-slot.is-hero { flex: 1; min-height: 0; display: flex; }
#yt-feed-slot { flex: 1; min-height: 0; display: flex; flex-direction: column; }

/* ---- Строка аккаунта (вошёл) ---- */
.yt-account-bar {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  flex: none;
}
.yt-avatar-stub {
  width: 32px; height: 32px; border-radius: 50%; flex: none;
  background: var(--surf2); color: var(--ink3);
  display: flex; align-items: center; justify-content: center;
}
.yt-account-bar > img.ava { width: 32px; height: 32px; }
.yt-account-error { margin: 0 12px 10px; }

/* ---- Герой «не вошёл» ---- */
.yt-hero {
  flex: 1; min-height: 0;
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; text-align: center;
  padding: 32px 24px; overflow: auto;
}
.yt-hero-mark {
  width: 72px; height: 72px; border-radius: 22px;
  background: var(--accentSoft); color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 18px;
}
.yt-hero-title { font-size: 26px; margin-bottom: 8px; }
.yt-hero-text { color: var(--ink3); max-width: 520px; margin-bottom: 20px; }
.yt-hero-actions { gap: 10px; margin-bottom: 12px; justify-content: center; }
.yt-hero-fine { max-width: 520px; line-height: 1.5; margin-bottom: 26px; }
.yt-hero-features {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px; width: 100%; max-width: 720px; text-align: left;
}
.yt-hero-feature { padding: 12px; }
.yt-hero-feature-ic {
  width: 26px; height: 26px; border-radius: 8px;
  background: var(--surf2); color: var(--ink2);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 8px;
}
.yt-hero-feature .t-xs { margin-top: 3px; }
.yt-hero-note {
  margin-top: 18px; width: 100%; max-width: 720px;
  background: var(--surf2); color: var(--ink2); align-items: center;
}

/* ---- Тело ленты: подписки слева + сетка справа ---- */
.yt-body { flex: 1; min-height: 0; display: flex; }
.yt-subs {
  width: 212px; flex: none;
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column; min-height: 0;
}
.yt-sub-row {
  display: flex; align-items: center; gap: 8px;
  width: 100%; height: 34px; padding: 0 8px; margin-bottom: 1px;
  border: 0; border-radius: 8px; background: none;
  color: var(--ink2); cursor: pointer; text-align: left;
}
.yt-sub-row:hover { background: var(--surf2); }
.yt-sub-row.is-on { background: var(--surf2); }
.yt-sub-ic {
  width: 22px; height: 22px; border-radius: 50%; flex: none;
  background: var(--surf2); color: var(--ink3);
  display: flex; align-items: center; justify-content: center;
}
.yt-sub-row.is-on .yt-sub-ic { background: var(--surface); }
.yt-sub-ava { width: 22px; height: 22px; }

.yt-main { flex: 1; min-width: 0; display: flex; flex-direction: column; min-height: 0; }
.yt-feed-head { flex-wrap: wrap; row-gap: 8px; height: auto; min-height: 46px; }
.yt-quality-select { height: 28px; padding: 0 8px; gap: 6px; font-size: 12px; }
.yt-feed-error { margin: 10px 12px 0; }

.yt-grid {
  padding: 12px;
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px; align-content: start;
}

.yt-card { overflow: hidden; }
.yt-card-shot {
  position: relative; display: block; width: 100%; padding: 0; border: 0;
  cursor: pointer; background: none;
}
.yt-card-shot img {
  width: 100%; height: 150px; object-fit: cover; display: block;
}
.yt-card-stub {
  width: 100%; height: 150px;
  display: flex; align-items: center; justify-content: center;
  background: var(--surf2); color: var(--ink4);
}
.yt-card-time {
  position: absolute; right: 6px; bottom: 6px;
  background: rgba(10, 12, 16, .82); color: var(--on-dark);
  font-size: 10.5px; font-weight: 600; padding: 2px 5px; border-radius: 4px;
}
/* Метка «уже скачано / в очереди / на паузе» — на кадре, слева сверху
   (артборд body_YouTube.html): в теле карточки она делала соседей по ряду
   разной высоты. */
.yt-card-state { position: absolute; left: 6px; top: 6px; max-width: calc(100% - 12px); }
.yt-card-play {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(10, 12, 16, .35); color: var(--on-dark);
  opacity: 0; transition: opacity .12s ease;
}
.yt-card-shot:hover .yt-card-play,
.yt-card-shot:focus-visible .yt-card-play { opacity: 1; }
.yt-card-body { padding: 8px 9px 9px; }
.yt-card-title { min-height: 34px; margin-bottom: 4px; }
.yt-card-channel {
  display: flex; align-items: center; gap: 5px;
  height: 20px; margin: 0 0 8px; padding: 0;
  border: 0; background: none; color: var(--ink3);
  font-size: 11px; cursor: default;
}
.yt-card-channel-ava { width: 15px; height: 15px; }
.yt-card-channel-ava-ph {
  display: flex; align-items: center; justify-content: center;
  color: var(--ink4); background: var(--surf2);
}
.yt-card-channel-ava-ph .ic14 { width: 10px; height: 10px; }
button.yt-card-channel-btn { cursor: pointer; }
button.yt-card-channel-btn:hover { color: var(--ink2); text-decoration: underline; }
.yt-card-actions { gap: 5px; }

.yt-feed-foot {
  margin-top: auto; padding: 9px 12px;
  border-top: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  flex: none;
}

/* ---- Меню аккаунта в шапке ---- */
.acct { position: relative; }
.acct-btn { gap: 6px; max-width: 180px; }
.acct-name { max-width: 100px; }
.acct-btn img.ava { width: 18px; height: 18px; }
.acct-menu {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 30;
  width: 220px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 10px; box-shadow: var(--sh2);
  overflow: hidden; padding: 6px;
}
.acct-menu-head { padding: 6px 8px 8px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.acct-menu-item {
  display: flex; align-items: center; gap: 8px;
  width: 100%; height: 32px; padding: 0 8px;
  border: 0; border-radius: 7px; background: none;
  color: var(--ink2); font: 600 12.5px/1 var(--font-ui);
  cursor: pointer; text-align: left;
}
.acct-menu-item:hover { background: var(--surf2); }
.acct-menu-item.is-danger { color: var(--err); }
.acct-menu-item.is-danger:hover { background: var(--errSoft); }

/* ---- Подсказки YouTube-поиска (#suggest-box, наполняет suggest.js) ---- */
.sug-row {
  display: flex; align-items: center; gap: 9px;
  height: 32px; padding: 0 10px; margin: 0 4px;
  border-radius: 7px; border: 0; background: none;
  width: calc(100% - 8px); color: var(--ink);
  font-size: 13px; text-align: left; cursor: pointer;
}
.sug-row:first-child { margin-top: 4px; }
.sug-row:last-child { margin-bottom: 4px; }
.sug-row:hover, .sug-row.is-on { background: var(--surf2); }
.sug-row .ic14 { color: var(--ink4); flex: none; }
.sug-cap { padding: 6px 14px 4px; }

/* ---- Модалка входа ---- */
.modal-ic {
  width: 32px; height: 32px; border-radius: 10px; flex: none;
  background: var(--accentSoft); color: var(--accent);
  display: flex; align-items: center; justify-content: center;
}
/* min-height:0 — колонка отдаёт всю свободную высоту окну браузера
   (.signin-window), а не растёт под его пропорцию. */
.signin-body { padding: 0 14px 10px; gap: 8px; overflow: hidden; min-height: 0; }

/* Окно занимает весь остаток высоты модалки (flex:1) — на нём и выигрывает
   почти-полноэкранная модалка, крупный масштаб удалённой страницы. Три шага
   больше не своя строка — они живут в строке заголовка окна (bar), поэтому
   каждый пиксель высоты сверх головы модалки и этой строки статуса достаётся
   удалённому экрану. */
.signin-window {
  flex: 1; min-height: 0;
  display: flex; flex-direction: column;
  border: 1px solid var(--line2); border-radius: 12px; overflow: hidden;
  background: var(--chrome-bg);
}
.signin-window-bar {
  height: 34px; flex: none;
  display: flex; align-items: center; gap: 10px; padding: 0 10px;
  background: var(--chrome-bar-bg); border-bottom: 1px solid var(--chrome-bar-border);
}
.signin-window-dots { display: flex; gap: 5px; flex: none; }
.signin-window-dots span {
  width: 9px; height: 9px; border-radius: 50%; background: var(--chrome-dot); display: block;
}
.signin-steps { display: flex; gap: 6px; flex: 1; min-width: 0; }
.signin-step {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px;
  padding: 3px 8px; border-radius: 7px;
  background: var(--surf2); color: var(--ink3);
}
.signin-step-badge {
  width: 15px; height: 15px; border-radius: 50%; flex: none;
  background: var(--surf3); color: var(--ink3);
  display: flex; align-items: center; justify-content: center;
  font-size: 10px;
}
.signin-step-text {
  font-size: 11px; font-weight: 600; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap;
}
.signin-step.is-done { background: var(--okSoft); color: var(--ok); }
.signin-step.is-done .signin-step-badge { background: var(--ok); color: var(--on-dark); }
.signin-step.is-current { background: var(--accentSoft); color: var(--accent); }
.signin-step.is-current .signin-step-badge { background: var(--accent); color: var(--on-dark); }
/* Область под удалённый экран: centер + max-height, а внутри — блок с
   aspect-ratio самого экрана (docker/browser/Dockerfile ENV SCREEN,
   по умолчанию 1440×900 = 8/5). Так noVNC (resize=scale) масштабирует
   картинку без чёрных полей — соотношение сторон совпадает всегда, а не
   только когда высота модалки случайно попала в нужную пропорцию. */
.signin-window-screen {
  flex: 1; min-height: 0; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  background: var(--chrome-screen-bg);
}
/* Точный размер (ширина и высота в px) считает signin.js — ResizeObserver
   на .signin-window-screen: CSS-только «contain» с aspect-ratio не умеет
   ужимать оба измерения сразу, когда один из них задан явно (100%), а не
   auto — только один. width/max-height ниже лишь начальная прикидка на
   первый кадр, до того как JS отмерил и подставил инлайновые px. */
.signin-frame-wrap {
  position: relative;
  width: 100%; max-height: 100%;
  aspect-ratio: 8 / 5;
}
.signin-frame { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; display: block; }
.signin-no-browser {
  position: absolute; inset: 0; z-index: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; padding: 24px; text-align: center;
  color: var(--chrome-text); font-size: 12px; line-height: 1.5;
}
.signin-no-browser .ic20 { color: var(--warn); }

/* Статус, кнопка «Забрать вход», подсказка про хранение сессии и резервный
   OAuth — одна строка вместо прежних трёх (plan: «низ … компактная одна-две
   строки»). Подсказка живёт в title значка (i), а не отдельным абзацем. */
.signin-footer {
  display: flex; align-items: center; gap: 10px; flex: none;
  padding-top: 8px; border-top: 1px solid var(--line);
}
.signin-spin {
  width: 16px; height: 16px; border-radius: 50%; flex: none;
  border: 2px solid var(--line2); border-top-color: var(--accent);
  animation: yts-spin .8s linear infinite;
}
#signin-go.is-off .signin-spin { display: none; }

/* ---- Приветствие в узкой рейке подсказок раздела ---- */
.yt-account-bar .tag { flex: none; }
