/* YouTube-like page header. Playback canvas and the existing six cards stay unchanged. */
#start-screen {
  padding: 0 20px 12px;
  background-color: #fff;
  background-image: none;
  color: #0f0f0f;
  font-family: Arial, "Noto Sans KR", sans-serif;
  overflow-y: auto;
}

#start-screen .media-topbar {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr) 160px;
  align-items: center;
  flex: 0 0 64px;
  width: 100%;
  height: 64px;
  min-height: 64px;
  margin: 0;
  position: sticky;
  top: 0;
  z-index: 20;
  background: #fff;
}

#start-screen .tv-youtube-logo {
  display: flex;
  width: 140px;
  align-items: center;
  gap: 3px;
  white-space: nowrap;
  color: #0f0f0f;
}

#start-screen .tv-youtube-logo > svg { display: block; flex: 0 0 30px; }
#start-screen .tv-youtube-wordmark {
  font-family: "Arial Narrow", Impact, sans-serif;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -1.4px;
  line-height: 28px;
}
#start-screen .tv-youtube-country {
  align-self: flex-start;
  margin: 0 0 0 1px;
  color: #606060;
  font-size: 10px;
  line-height: 14px;
}

#start-screen #url-form {
  display: flex;
  width: 100%;
  max-width: 580px;
  height: 40px;
  min-width: 0;
  gap: 0;
  justify-self: center;
  flex-direction: row;
}

#start-screen #video-url {
  flex: 1 1 auto;
  min-width: 0;
  height: 40px;
  margin: 0;
  border: 1px solid #c6c6c6;
  border-radius: 22px 0 0 22px;
  padding: 0 16px;
  background: #fff;
  box-shadow: inset 0 1px 2px #eee;
  color: #0f0f0f;
  caret-color: #0f0f0f;
  font-size: 16px;
}
#start-screen #video-url::placeholder { color: #707070; opacity: 1; }
#start-screen #video-url:focus { border-color: #1c62b9; }
#start-screen #video-url:focus-visible { outline: 1px solid #1c62b9; outline-offset: -1px; }

#start-screen #url-form .icon-button {
  display: flex;
  flex: 0 0 60px;
  width: 60px;
  min-width: 60px;
  height: 40px;
  align-items: center;
  justify-content: center;
  border: 1px solid #d3d3d3;
  border-left: 0;
  border-radius: 0 22px 22px 0;
  padding: 0;
  background: #f8f8f8;
  color: #0f0f0f;
}
#start-screen #url-form .icon-button:hover { background: #f0f0f0; border-color: #c6c6c6; }
#start-screen #url-form .icon-button:focus-visible { outline: 2px solid #1c62b9; outline-offset: 1px; }

#start-screen .input-message-region { margin: 0 0 5px; }
#start-screen .input-status,
#start-screen .source-detection,
#start-screen .search-boundary,
#start-screen .search-boundary span { color: #606060; }
#start-screen .input-status[data-kind="loading"] { color: #1c62b9; }
#start-screen .input-status[data-kind="error"],
#start-screen .error-message { color: #b3261e; }

#start-screen .link-preview { border-color: #ddd; background: #f8f8f8; color: #0f0f0f; }
#start-screen .link-preview p { color: #606060; }
#start-screen .link-preview button { border-color: #d3d3d3; background: #f2f2f2; color: #0f0f0f; }
#start-screen .link-preview button:focus-visible { outline-color: #1c62b9; }

#start-screen .search-pagination { background: #fff; color: #606060; }
#start-screen .search-pagination button { border-color: #d3d3d3; background: #f2f2f2; color: #0f0f0f; }
#start-screen .search-pagination button:focus-visible { outline-color: #1c62b9; }

#start-screen #tv-home-feed { flex: 0 0 auto; min-width: 0; padding: 8px 0 20px; }
#start-screen .tv-home-section h2 { display: flex; align-items: center; gap: 8px; margin: 0 0 16px; color: #0f0f0f; font-size: 20px; line-height: 28px; font-weight: 700; }
#start-screen .tv-home-videos { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px 16px; }
#start-screen .tv-home-shorts-section { margin-top: 28px; }
#start-screen .tv-home-shorts { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; align-items: start; }
#start-screen .tv-home-card { display: block; width: 100%; min-width: 0; border: 0; border-radius: 0; padding: 0; background: transparent; color: #0f0f0f; text-align: left; text-decoration: none; cursor: pointer; }
#start-screen .tv-home-card img { display: block; width: 100%; aspect-ratio: 16 / 9; border-radius: 12px; background: #f2f2f2; object-fit: cover; }
#start-screen .tv-home-shorts .tv-home-card img { aspect-ratio: 9 / 16; }
#start-screen .tv-home-title { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; margin: 9px 0 4px; color: #0f0f0f; font-size: 14px; font-weight: 600; line-height: 1.4; }
#start-screen .tv-home-meta { display: block; color: #606060; font-size: 12px; line-height: 1.5; }
#start-screen .tv-home-card:focus-visible { outline: 2px solid #1c62b9; outline-offset: 3px; border-radius: 12px; }
#start-screen #tv-home-logo { border: 0; padding: 0; background: transparent; text-align: left; }
#start-screen #tv-home-status { margin: 0 0 12px; color: #606060; font-size: 13px; line-height: 1.5; }
#start-screen #tv-home-status:empty { display: none; }

/* Only the ordinary-browser home screen expands. Playback and shared SL media
   continue using their original fixed stage. */
@supports selector(:has(*)) {
  html:not(.shared-media) #app:has(> #start-screen:not([hidden])) {
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    min-width: 0;
    max-width: none;
    min-height: 0;
    max-height: none;
    transform: none;
  }
  html:not(.shared-media) #app:has(> #start-screen:not([hidden])) > #start-screen {
    width: 100%;
    height: 100%;
    min-width: 0;
    max-width: none;
    min-height: 0;
    max-height: none;
  }
}

@media (max-width: 700px) {
  html:not(.shared-media) #start-screen { padding-right: 12px; padding-left: 12px; }
  html:not(.shared-media) #start-screen .media-topbar { grid-template-columns: 110px minmax(0, 1fr); }
  html:not(.shared-media) #start-screen .tv-youtube-logo { width: 106px; gap: 2px; }
  html:not(.shared-media) #start-screen .tv-youtube-logo > svg { width: 25px; height: 19px; flex-basis: 25px; }
  html:not(.shared-media) #start-screen .tv-youtube-wordmark { font-size: 22px; letter-spacing: -1.5px; }
  html:not(.shared-media) #start-screen .tv-youtube-country { margin-left: 0; font-size: 8px; }
  html:not(.shared-media) #start-screen #url-form .icon-button { flex-basis: 44px; width: 44px; min-width: 44px; }
  html:not(.shared-media) #start-screen #video-url { padding-right: 10px; padding-left: 12px; }
  html:not(.shared-media) #start-screen .tv-home-videos { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 12px; }
  html:not(.shared-media) #start-screen .tv-home-shorts { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  html:not(.shared-media) #start-screen .search-results:not([hidden]) { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: repeat(3, minmax(0, 1fr)); }
}

#start-screen { overflow-anchor: none; }

#start-screen { justify-content: flex-start; align-content: normal; }
