.tab-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 60;
  height: 96px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  padding: 0 80px;
  background: var(--glass-tint);
  border-bottom: 1px solid var(--glass-edge);
  box-shadow: inset 0 -1px 0 var(--glass-highlight);
}

/* Blurs what is behind it only where the page runs under the bar (a title
   page's backdrop, utils/bar-backdrop.ts); elsewhere nothing is there, and
   the filter alone cost the C3 a fifth of its frames on the Movies home. */
.tab-bar.tab-bar--on-picture {
  backdrop-filter: var(--glass-filter);
}

/* The home's hero under the glass (utils/bar-backdrop.ts): the page starts
   below the bar, so the picture is drawn here, blurred, over the tint. */
.tab-bar::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: -1;
  background-image: var(--bar-backdrop, none);
  /* Drawn as the hero draws it (.gh-hero: 1920x532 under the bar, cover,
     20% down), so the bar shows the part of the picture just above the
     hero, cut off there, not a second copy of the picture's middle (a face
     behind the glass while the hero below shows the sky). A backdrop fills
     the width, so it is 1920px wide here too; the hero's 20% puts the
     picture's top at 96px + 20% of (532px - its height), which as a
     position in this 96px box is 20% + 183.2px. */
  background-size: 1920px auto;
  background-position: center calc(20% + 183.2px);
  opacity: 0.55;
  filter: blur(18px) saturate(140%);
  pointer-events: none;
}

/* Glass effects off: no picture in the bar either. */
html[data-glass="off"] .tab-bar::before {
  display: none;
}

/* Hidden on the full-screen player. */
.tab-bar--hidden {
  display: none;
}

/* When the bar is docked, the section views sit below it (never overlapping);
   the full-screen player / loading views keep top:0 / full height. */
body.tabbar-docked #view-channels,
body.tabbar-docked #view-epg,
body.tabbar-docked #view-movies,
body.tabbar-docked #view-series,
body.tabbar-docked #view-search,
body.tabbar-docked #view-settings {
  top: 96px;
  height: 984px;
}

/* The guide's own root is fixed-height; shrink it to the docked viewport. */
body.tabbar-docked #view-epg .epg-view {
  height: 984px;
}

.tab-bar-inner {
  display: flex;
  align-items: center;
  gap: 32px;
  width: 100%;
}

.tab-bar-title {
  /* The wordmark (assets/logo, made by design/logo/make-logo.py). */
  flex-shrink: 0;
  height: 44px;
  width: auto;
  margin-left: -32px;
  margin-right: 32px;
}

.tab-bar-item {
  flex-shrink: 0;
  font-family: inherit;
  font-size: calc(30px * var(--font-scale));
  font-weight: 700;
  line-height: 1.4;
  color: var(--text-secondary);
  background: transparent;
  border: none;
  padding: 4px 2px;
  border-bottom: 3px solid transparent;
  cursor: pointer;
}

.tab-bar-item.active {
  color: var(--text-primary);
  border-bottom-color: var(--accent);
}

.tab-bar-item.focused,
.tab-bar-item:hover,
.tab-bar-item:focus {
  color: var(--accent);
  /* The outline alone: a filled box (dark, then a light frost) looked
     pasted onto the glass (the owner). */
  background: transparent;
  outline: 2px solid var(--accent);
  outline-offset: 4px;
  border-radius: 4px;
}

.tab-bar-search {
  flex-shrink: 0;
  margin-left: auto;
  display: flex;
  align-items: center;
  /* Not hidden: the collapsed input already has width/opacity/padding at 0,
     so nothing needs clipping, and overflow:hidden here was cutting the
     focus glow off the search icon's left/right edges. */
  overflow: visible;
}

.tab-bar-search-input {
  width: 0;
  opacity: 0;
  padding: 0;
  margin: 0;
  border: none;
  box-sizing: border-box;
  height: 52px;
  background: var(--bg-tertiary);
  color: var(--text-primary);
  font-family: inherit;
  font-size: calc(26px * var(--font-scale));
  border-radius: 8px;
  transition: width 260ms ease, opacity 200ms ease, padding 260ms ease, margin 260ms ease;
}

.tab-bar-search.expanded .tab-bar-search-input {
  opacity: 1;
  padding: 0 18px;
  margin-right: 14px;
}

.tab-bar-search-input:focus {
  outline: none;
}

/* Highlighted from the D-pad but not focused (no keyboard yet): OK opens it. */
.tab-bar-search-input.focused:not(:focus) {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

.search-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 6px;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
}

.search-icon svg {
  width: 32px;
  height: 32px;
  display: block;
}

.search-icon.focused,
.search-icon.active {
  color: var(--text-primary);
  border: none;
  box-shadow: none;
}

.settings-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 6px;
  margin-left: 4px;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
}

.settings-icon svg {
  width: 30px;
  height: 30px;
  display: block;
}

.settings-icon.focused,
.settings-icon.active {
  color: var(--text-primary);
  border: none;
  box-shadow: none;
}
