/**
 * trubible.com pages inside the TruBible OS window (TINL-1378). Only on a computer (`html.tbos-desktop`,
 * set by /os/tb-os.js); phones, tablets and the store apps never match these rules.
 */
html.tbos-desktop body { min-height: 0; }
/* the free-setup announcement is Help → "Free setup help" in the menu bar here */
html.tbos-desktop .support-bar { display: none; }
/* Signed in, the page's top bar is not drawn: everything on it is in the desktop's own bars. Dashboard is the
   TruBible icon in the left bar (and Go), the other apps are in the left bar, language and Light/Dark are in Controls,
   the account and Sign out are the avatar, support and status are under Help, Admin is under Go. */
html.tbos-desktop .navbar.nav-user { display: none; }
html.tbos-desktop body:has(.navbar.nav-user) { --nav-h: 0px; }
/* signed out (the sign-in page), the bar stays, without what the menu bar already has */
html.tbos-desktop .navbar { padding-inline: 20px; }
html.tbos-desktop .navbar .theme-btn,
html.tbos-desktop .navbar .lang-switcher { display: none; }
/* pages that filled the screen fill the window */
html.tbos-desktop .auth-split,
html.tbos-desktop .callback-page { min-height: 100%; }

/* ---------- Inside an app ---------- */
/* the free-setup announcement is a website banner; inside the app the same page is one tap away in the menu */
html.tbos-app .support-bar { display: none; }

/* ---------- A window with a side panel (the home page): the panel is the navigation ---------- */
html.tbos-desktop .tbos-body:has(> .tbos-side) > .navbar { display: none; }
html.tbos-desktop body:has(.tbos-side) { --nav-h: 0px; }

/* ---------- Phones: the top bar is a title bar (TINL-1382) ----------
   Back on every screen but the first of its app, the screen's title once you scroll (the page's own large
   heading is the title until then), search and the menu on the right. Light and Dark move into the menu. */
.navbar .nav-back, .navbar .nav-title { display: none; }
.nav-drawer-theme { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.nav-drawer-theme button { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: transparent; color: var(--text); font: inherit; font-weight: 600; cursor: pointer; }
.nav-drawer-theme button[aria-pressed="true"] { background: var(--brand-soft); border-color: var(--brand-line); color: var(--brand); }
.nav-drawer-theme svg { width: 18px; height: 18px; }
@media (max-width: 760px) {
  html.tbos .navbar { padding-inline: 10px; gap: 4px; }
  html.tbos .navbar .theme-btn { display: none; }
  html.tbos .navbar:not(.nav-root) .logo { display: none; }
  html.tbos .navbar .nav-back:not([hidden]) { display: inline-grid; place-items: center; flex: none; width: 44px; height: 44px; margin-left: -6px; margin-right: auto; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--brand); cursor: pointer; }
  html.tbos .navbar .nav-back svg { width: 27px; height: 27px; stroke-width: 2.4; }
  html.tbos .navbar .nav-back:active { background: var(--bg-hover); }
  html.tbos .navbar:not(.nav-root) .nav-title { display: block; position: absolute; left: 60px; right: 108px; text-align: center; font: 600 1.02rem/1.2 var(--font-body); color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; pointer-events: none; opacity: 0; transform: translateY(5px); transition: opacity 180ms ease, transform 180ms ease; }
  html.tbos .navbar.scrolled:not(.nav-root) .nav-title { opacity: 1; transform: none; }
  html.tbos .breadcrumb { display: none; }
}
@media (max-width: 760px) and (prefers-reduced-motion: reduce) { html.tbos .navbar .nav-title { transition: none; } }

/* ---------- Computers: a page's own section list is the window's side panel (TINL-1382) ----------
   Settings, the event editor and the team page each had a list of sections beside the content. In the window
   that list is the glass side panel, full height at the window's left edge, with the same rows as every other
   side panel (tb-os.css, .tbos-side); the content is the pane beside it. The markup is unchanged. */

/* Settings and the event editor (.settings-layout > .settings-nav + .settings-main) */
html.tbos-desktop .tbos-body:has(.settings-nav) { background: linear-gradient(to right, transparent 250px, var(--os-win-bg) 250px); }
html.tbos-desktop main.page:has(> .settings-layout) { display: grid; grid-template-columns: 250px minmax(0, 1fr); grid-auto-rows: min-content; align-content: start; max-width: none; min-height: var(--app-vh); margin: 0; padding: 0 0 56px; box-sizing: border-box; }
html.tbos-desktop main.page:has(> .settings-layout) > *,
html.tbos-desktop main.page:has(> .settings-layout) > .settings-layout > .settings-main { grid-column: 2; width: min(880px, 100% - 2 * clamp(24px, 4vw, 56px)); margin-inline: clamp(24px, 4vw, 56px); box-sizing: border-box; }
html.tbos-desktop main.page:has(> .settings-layout) > :first-child { margin-top: 28px; }
html.tbos-desktop .settings-layout { display: contents; }
html.tbos-desktop main.page:has(> .settings-layout) .settings-nav {
  grid-column: 1; grid-row: 1 / span 60; position: sticky; top: 0; z-index: 3; width: auto; height: var(--app-vh); margin: 0; box-sizing: border-box; padding: 16px 10px 12px; gap: 2px; overflow-y: auto;
  background: var(--os-glass-side); -webkit-backdrop-filter: var(--os-blur); backdrop-filter: var(--os-blur); border-right: 1px solid var(--os-line);
}
html.tbos-desktop .settings-nav a { min-height: 32px; padding: 0 10px; border: 0; border-radius: 8px; font: 500 13.5px/1.25 var(--os-font); color: var(--os-ink); }
html.tbos-desktop .settings-nav a svg { color: var(--brand); }
html.tbos-desktop .settings-nav a:hover { background: var(--os-hover); color: var(--os-ink); }
html.tbos-desktop .settings-nav a.active { padding: 0 10px; border: 0; background: var(--brand); color: var(--on-brand); font-weight: 500; }
html.tbos-desktop .settings-nav a.active svg { color: inherit; }

/* The team page (.team-shell > .team-side + .team-main) */
html.tbos-desktop .tbos-body:has(> .team-shell) { background: linear-gradient(to right, transparent 276px, var(--os-win-bg) 276px); }
html.tbos-desktop .team-shell { grid-template-columns: 276px minmax(0, 1fr); gap: 0; max-width: none; min-height: var(--app-vh); margin: 0; padding: 0; }
html.tbos-desktop .team-side { top: 0; height: var(--app-vh); max-height: none; box-sizing: border-box; padding: 14px 12px 16px; background: var(--os-glass-side); -webkit-backdrop-filter: var(--os-blur); backdrop-filter: var(--os-blur); border-right: 1px solid var(--os-line); }
html.tbos-desktop .team-main { max-width: 1180px; padding: 28px clamp(24px, 3.2vw, 48px) 64px; box-sizing: border-box; }
html.tbos-desktop .team-nav-label { color: var(--os-ink-2); }
html.tbos-desktop .team-nav-item { min-height: 32px; padding-block: 0; border-radius: 8px; font: 500 13.5px/1.25 var(--os-font); color: var(--os-ink); }
html.tbos-desktop .team-nav-item svg { width: 17px; height: 17px; color: var(--brand); }
html.tbos-desktop .team-nav-item:hover { background: var(--os-hover); color: var(--os-ink); }
html.tbos-desktop .team-nav-item:hover svg { color: var(--brand); }
html.tbos-desktop .team-nav-item.active { background: var(--brand); color: var(--on-brand); font-weight: 500; box-shadow: none; }
html.tbos-desktop .team-nav-item.active svg { color: inherit; transform: none; }
html.tbos-desktop .team-nav-item.active::before { display: none; }
html.tbos-desktop .team-nav-item.active .team-nav-count { background: rgba(255, 255, 255, 0.24); color: inherit; }
html.tbos-desktop .team-back { color: var(--os-ink-2); }

/* ---------- Moving between pages: the window stays, the content changes (TINL-1382) ----------
   The site already uses the browser's page transitions (css/style.css). On phones the top bar and the tab bar
   stay still while the page changes under them. */
html.tbos .tabbar { view-transition-name: site-tabbar; }
html.tb-theme-switching .tabbar { view-transition-name: none; }
/* On a computer nothing is carried separately (tb-os.css says why): the top bar is not drawn there anyway. */
html.tbos-desktop .navbar { view-transition-name: none; }
