/* Search keeps its existing input and native editing flow. The focus ring is
   painted inside the border, with room at both edges of the clipping parent. */
.tv-shell .collections-page .search-label { margin: 0; }
.tv-shell .search-field { position: relative; flex: none; min-width: 0; margin: 10px 4px 24px; }
.tv-shell .search-field .search-input { width: 100%; box-sizing: border-box; margin: 0; padding: 12px 24px; }
[dir=ltr] .tv-shell .search-field.has-clear .search-input { padding-right: 80px; }
[dir=rtl] .tv-shell .search-field.has-clear .search-input { padding-left: 80px; }
.tv-shell .search-field .search-input:focus { outline: none; }
.tv-shell .search-field:focus-within .search-input {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
}
.tv-shell .search-field .search-clear {
  position: absolute; top: 8px; right: 8px; width: 52px; height: 52px;
  padding: 0; border: 2px solid transparent; border-radius: 9px;
  background: var(--elevated); color: var(--text);
  display: flex; align-items: center; justify-content: center;
}
[dir=rtl] .tv-shell .search-field .search-clear { right: auto; left: 8px; }
.tv-shell .search-field .search-clear[hidden] { display: none; }
.tv-shell .search-field .search-clear:focus { outline: none; box-shadow: none; border-color: var(--accent); }

/* Recent and Last Channel share one independent card box. The image is out
   of flow, so its intrinsic dimensions cannot size the card or grid row. */
.tv-shell .library-grid[data-tab=RECENT_CHANNELS] .recent-channel-card {
  position: relative; display: flex; flex-direction: column; align-self: start;
  min-width: 0; width: 100%; height: 264px; min-height: 264px; max-height: 264px;
  border: 2px solid var(--elevated); border-radius: 14px; padding: 0;
  overflow: hidden; background: var(--surface); text-align: start;
}
.tv-shell .library-grid[data-tab=RECENT_CHANNELS] .recent-channel-card > .artwork-frame {
  position: relative; display: block; width: 100%; height: 148px; min-height: 148px;
  max-height: 148px; flex: 0 0 148px; padding: 0; overflow: hidden;
  background: var(--elevated);
}
.tv-shell .library-grid[data-tab=RECENT_CHANNELS] .recent-channel-card .provider-image {
  position: absolute; left: 8%; top: 14%; width: 84%; height: 72%;
  min-width: 0; min-height: 0; max-width: 100%; max-height: 100%; padding: 0;
  object-fit: contain; object-position: center;
}
.tv-shell .library-grid[data-tab=RECENT_CHANNELS] .recent-channel-card .artwork-fallback {
  position: absolute; left: 0; top: 0; width: 100%; height: 100%;
}
.tv-shell .library-grid[data-tab=RECENT_CHANNELS] .recent-channel-card .media-caption {
  height: 112px; min-height: 0; flex: 0 0 112px; box-sizing: border-box; padding: 10px 12px;
}
.tv-shell .library-grid[data-tab=RECENT_CHANNELS] .recent-channel-card .catalog-card-title {
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2;
  height: 62px; min-height: 0; line-height: 31px; padding: 0;
  white-space: normal; overflow-wrap: break-word; overflow: hidden;
}
.tv-shell .library-grid[data-tab=RECENT_CHANNELS] .recent-channel-card .catalog-card-meta { padding: 0; }
.tv-shell .library-grid[data-tab=RECENT_CHANNELS] .recent-channel-card .last-channel-label {
  position: absolute; top: 6px; right: 6px; padding: 3px 8px; border-radius: 6px;
  color: var(--accent); background: var(--canvas); font-size: 16px;
}
[dir=ltr] .tv-shell .library-grid[data-tab=RECENT_CHANNELS] .recent-channel-card .last-channel-label { right: auto; left: 6px; }
.tv-shell .library-grid[data-tab=RECENT_CHANNELS] .recent-channel-card:focus {
  border-color: var(--accent); box-shadow: none; outline: none;
}

/* Give names the actual text column width. Flex cannot compress a two-line
   name, and the existing card dimensions leave room for the PIN label. */
.auth-host > .profiles-layout .profile-card { padding-top: 16px; padding-bottom: 16px; }
.auth-host > .profiles-layout .profile-avatar { flex: none; margin-bottom: 8px; }
.auth-host > .profiles-layout .profile-protected { margin-top: 4px; }
.auth-host > .profiles-layout .profile-card .profile-name,
.tv-shell .managed-profile-copy strong {
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2;
  box-sizing: border-box; flex: none; width: 100%; min-width: 0; max-width: 100%;
  height: auto; line-height: 1.3; white-space: normal; overflow-wrap: break-word; overflow: hidden;
}
.auth-host > .profiles-layout .profile-card .profile-name { margin-bottom: 4px; padding: 3px 0; }
