/* ═══════════════════════════════ shell ═══════════════════════════════ */
.shell { min-height: 100dvh; display: flex; flex-direction: column; }

.topbar { position: sticky; top: 0; z-index: 50; height: var(--nav-h); display: flex; align-items: center;
  background: rgba(7,9,14,.55); border-bottom: 1px solid var(--line);
  -webkit-backdrop-filter: blur(var(--blur)) saturate(150%); backdrop-filter: blur(var(--blur)) saturate(150%); }
.topbar-inner { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 var(--gutter); display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand img { width: 36px; height: 36px; border-radius: 11px; }
.brand-name { font-family: var(--font-display); font-weight: 700; font-size: 18px; letter-spacing: .02em; line-height: 1; }
.brand-sub { font-size: 11px; color: var(--text-3); letter-spacing: .08em; text-transform: uppercase; margin-top: 3px; }
.topbar-right { display: flex; align-items: center; justify-content: flex-end; gap: 10px; position: relative; }
.topbar-right .search { width: 260px; }
.role-pill { position: absolute; right: -4px; bottom: -4px; padding: 1px 6px; border-radius: 99px; font-size: 9.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; background: var(--accent); color: #fff; border: 2px solid var(--bg); }
.role-pill.staff { background: var(--surface-3); color: var(--text); }
.user-btn { position: relative; }

.subnav { position: sticky; top: var(--nav-h); z-index: 40; }
.subnav-inner { max-width: var(--container); margin: 0 auto; padding: 14px var(--gutter) 6px; }

.page { flex: 1; width: 100%; max-width: var(--container); margin: 0 auto; padding: 26px var(--gutter) calc(48px + var(--bottom-nav-h)); display: grid; grid-template-columns: minmax(0, 1fr); gap: 34px; align-content: start; }
.page > * { min-width: 0; }
.page-narrow { max-width: 860px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; flex-wrap: wrap; }
.page-head .eyebrow { font-size: 12.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); margin-bottom: 8px; display: inline-flex; align-items: center; gap: 8px; }
.page-head .eyebrow svg { width: 14px; height: 14px; }
.page-head p { color: var(--text-2); margin-top: 8px; max-width: 620px; }
.page-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.two-col { display: grid; gap: 22px; grid-template-columns: minmax(0, 1fr) 360px; align-items: start; }
.three-col { display: grid; gap: 18px; min-width: 0; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.stack { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
.stack-sm { display: grid; gap: 10px; }
.cluster { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.cluster > svg { width: 16px; height: 16px; flex: none; }
.eyebrow svg, .login-domain svg { width: 14px; height: 14px; }
.between { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }

/* bottom nav — mobile only (ref: Home / Library / Inbox / Profile) */
.bottom-nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; height: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
  display: none; grid-template-columns: repeat(4, 1fr); align-items: center; background: rgba(7,9,14,.8); border-top: 1px solid var(--line);
  -webkit-backdrop-filter: blur(var(--blur)); backdrop-filter: blur(var(--blur)); }
.bottom-nav a { display: grid; justify-items: center; gap: 4px; font-size: 11px; font-weight: 500; color: var(--text-3); padding: 10px 0; position: relative; }
.bottom-nav a svg { width: 22px; height: 22px; }
.bottom-nav a.active { color: var(--text); }
.bottom-nav a.active::after { content: ''; position: absolute; top: 2px; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }

@media (max-width: 900px) {
  .two-col { grid-template-columns: 1fr; }
  .topbar-inner { grid-template-columns: auto 1fr; }
  .topbar-center { display: none; }
  .topbar-right .search { width: 100%; max-width: 220px; }
}
@media (max-width: 768px) {
  :root { --nav-h: 64px; }
  .bottom-nav { display: grid; }
  .brand-sub { display: none; }
  .brand img { width: 32px; height: 32px; }
  .topbar-right .search { display: none; }
  .hide-mobile { display: none !important; }
}
@media (min-width: 769px) {
  .page { padding-bottom: 60px; }
  .only-mobile { display: none !important; }
}

/* bare shell for public pages (login / 404 when signed out) */
.shell.bare .topbar, .shell.bare .bottom-nav { display: none; }

/* Every vertical stacking grid gets an explicit shrinkable track, otherwise implicit `auto`
   tracks size to the min-content of horizontal rails/tables and widen the whole page. */
.ott-rows, .stack, .stack-sm, .live-stage, .placeholder, .batch-list, .welcome, .side-cards > *, .row-block, .two-col > *, .watch-grid > *, .three-col > * { min-width: 0; }
.ott-rows, .stack, .stack-sm, .live-stage, .placeholder, .batch-list, .welcome { grid-template-columns: minmax(0, 1fr); }
