/* OpenNava search: shared palette, Media library and YouTube, inline TV keyboard. */
.tube-page {
  --tube-surface: #202924;
  --tube-subtle: #a7b4aa;
  padding: 30px var(--pad, 5vw) 48px;
  min-height: calc(100vh - 160px);
  background: radial-gradient(ellipse at 8% 0, #26372c50, transparent 60%);
}
.tube-top { display: flex; align-items: flex-end; justify-content: space-between; gap: 32px; margin-bottom: 30px; }
.tube-brand { display: flex; align-items: center; gap: 9px; color: #eef2ed; font-size: 10px; letter-spacing: 2px; font-weight: 650; }
.tube-brand-mark { width: 30px; height: 22px; border-radius: 7px; color: #fff; background: #c44842; display: grid; place-items: center; }
.tube-brand-mark svg { width: 17px; height: 17px; }
.tube-brand i { font-style: normal; color: var(--accent, #d2edbe); margin-left: 8px; font-size: 9px; font-weight: 500; }
.tube-provider-mediathek .tube-brand-mark { background: #a9c39d; color: #263c2a; }
.tube-provider-mediathek .tube-brand-mark svg { width: 15px; height: 15px; }
.tube-intro h1 { font-size: clamp(28px, 3.3vw, 46px); font-weight: 500; letter-spacing: -1.6px; line-height: 1.2; margin-top: 16px; }
.tube-search-region { width: 43%; max-width: 520px; min-width: 310px; flex-shrink: 0; }
.tube-providers { display: flex; width: max-content; padding: 4px; gap: 4px; margin-bottom: 10px; border: 1px solid #cfdec913; background: #111b16; border-radius: 12px; }
.tube-providers button { display: flex; align-items: center; justify-content: center; gap: 7px; padding: 8px 17px; border-radius: 8px; color: #98aa9d; font-size: 12px; font-weight: 550; }
.tube-providers button[aria-pressed=true] { color: #e5efdf; background: #334736; box-shadow: inset 0 1px 0 #e6f3df0b; }
.tube-providers button svg { width: 16px; height: 16px; }
.tube-search { display: flex; align-items: center; gap: 13px; width: 100%; min-width: 0; height: 58px; padding: 0 19px; border-radius: 18px; background: #28332d; border: 1px solid #c8d8c91a; text-align: left; flex-shrink: 0; box-shadow: inset 0 1px 0 #ffffff05; }
.tube-search>svg { width: 21px; height: 21px; color: var(--accent, #d2edbe); }
.tube-search>span:nth-child(2) { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tube-placeholder { color: #a8b6ab; }
.tube-search-key { margin-left: auto; color: #899b8e; }
.tube-search-key svg { width: 20px; height: 20px; }
.tube-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding-bottom: 25px; border-bottom: 1px solid #d7e5d60e; }
.tube-broadcasters { display: flex; align-items: center; gap: 3px; padding: 4px; margin-left: auto; border-radius: 24px; background: #ffffff05; border: 1px solid #ffffff0b; }
.tube-broadcasters button { padding: 7px 11px; border-radius: 20px; color: #8fa694; font-size: 11px; font-weight: 550; }
.tube-broadcasters button[aria-pressed=true] { background: #d2edbe1c; color: #d7e9ce; }
.tube-topics { display: flex; gap: 9px; flex-wrap: wrap; }
.tube-topic { padding: 11px 20px; border-radius: 30px; background: #ffffff06; color: #b7c3bb; border: 1px solid #ffffff0d; font-size: 12px; font-weight: 500; }
.tube-topic[aria-pressed=true] { background: var(--accent, #d2edbe); color: var(--accent-ink, #23351a); border-color: transparent; }
.tube-refresh { display: grid; place-items: center; width: 39px; height: 39px; border: 1px solid #ffffff15; border-radius: 50%; color: #9db0a1; flex-shrink: 0; }
.tube-refresh svg { width: 17px; height: 17px; }
.tube-context { display: flex; align-items: center; gap: 11px; margin-top: 18px; color: #8eaa95; }
.tube-context>span { font-size: 9px; letter-spacing: 1.6px; font-weight: 600; }
.tube-context button { display: flex; align-items: center; gap: 10px; border-radius: 24px; padding: 8px 12px; color: var(--accent, #d2edbe); background: #adc7a411; border: 1px solid #adc7a42b; font-size: 12px; }
.tube-context svg { width: 13px; height: 13px; }
.tube-results-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 20px; margin: 26px 0 20px; }
.tube-results-heading h2 { font-size: 20px; font-weight: 500; letter-spacing: -.4px; line-height: 1.4; }
.tube-results-heading>span { color: #7f9385; font-size: 10px; white-space: nowrap; letter-spacing: .4px; }
.tube-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); column-gap: 20px; row-gap: 32px; }
.tube-shelf + .tube-shelf { margin-top: 36px; padding-top: 25px; border-top: 1px solid #d7e5d60e; }
.tube-shelf-title { font-size: 18px; font-weight: 500; letter-spacing: -.3px; margin-bottom: 18px; }
.tube-more-row { display: flex; align-items: center; gap: 15px; margin-top: 23px; }
.tube-more-row p { color: #aebbb0; font-size: 12px; }
.tube-more svg { width: 15px; height: 15px; }
.tube-video { min-width: 0; }
.tube-video-open { display: block; width: 100%; text-align: left; padding: 0; border-radius: 14px; }
.tube-thumbnail { display: block; position: relative; width: 100%; aspect-ratio: 16 / 9; overflow: hidden; border-radius: 13px; background: #26332c; border: 1px solid #ffffff0a; }
.tube-thumbnail img { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; transition: transform .28s, filter .28s; }
.tube-thumbnail-fallback { position: absolute; inset: 0; display: grid; place-items: center; color: #a4b8a552; background: radial-gradient(ellipse at 30% 20%, #63766038, transparent 80%); }
.tube-thumbnail-fallback svg { width: 40px; height: 40px; }
.tube-duration { position: absolute; right: 9px; bottom: 8px; padding: 4px 6px; border-radius: 5px; color: #fff; font-size: 10px; font-weight: 600; font-variant-numeric: tabular-nums; background: #070b09dc; }
.tube-live-badge { position: absolute; left: 10px; top: 10px; display: inline-flex; align-items: center; gap: 5px; padding: 5px 7px; background: #152019e8; color: #f3f6ed; border: 1px solid #ffffff23; border-radius: 5px; font-size: 9px; font-weight: 650; letter-spacing: .8px; }
.tube-live-badge i { width: 5px; height: 5px; border-radius: 50%; background: #da675f; }
.tube-broadcast-meta { display: flex; align-items: center; gap: 8px; min-height: 20px; color: #95a99b; font-size: 10px; }
.tube-sender { display: inline-flex; align-items: center; font-size: 9px; font-weight: 650; letter-spacing: .4px; line-height: 1; border-radius: 4px; padding: 4px 6px; color: #c5dce5; background: #36526559; }
.tube-sender-zdf { color: #e1c6a1; background: #7055304d; }
.tube-play-overlay { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -44%) scale(.85); opacity: 0; width: 47px; height: 47px; display: grid; place-items: center; background: var(--accent, #d2edbe); color: var(--accent-ink, #23351a); border-radius: 50%; box-shadow: 0 3px 20px #0006; transition: opacity .2s, transform .2s; }
.tube-play-overlay svg { width: 25px; height: 25px; }
.tube-video-title { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin: 13px 2px 0; color: #ecf1eb; line-height: 1.42; font-size: 14px; font-weight: 550; letter-spacing: -.15px; }
.tube-video-meta { display: flex; flex-direction: column; gap: 4px; margin: 7px 2px 0; font-size: 11px; line-height: 1.4; color: var(--tube-subtle); }
.tube-author { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tube-views { color: #7f9385; font-size: 10px; }
.tube-video-open:hover { filter: none; }
.tube-video-open:hover img, .tube-video-open:focus img { transform: scale(1.04); filter: brightness(.7); }
.tube-video-open:hover .tube-play-overlay, .tube-video-open:focus .tube-play-overlay { transform: translate(-50%, -50%) scale(1); opacity: 1; }
.tube-page button:focus-visible, .native-tv .tube-page button:focus { outline: 3px solid var(--accent, #d2edbe); outline-offset: 5px; }
.tube-video-open:focus-visible, .native-tv .tube-video-open:focus { outline-offset: 7px; }
.tube-search:hover, .tube-topic:not([aria-pressed=true]):hover { background: #344238; filter: none; }
.tube-loading-note { display: flex; align-items: center; gap: 10px; color: #a4b5a8; font-size: 12px; margin: 2px 0 20px; }
.tube-spinner { width: 15px; height: 15px; border: 2px solid #a6c19e26; border-top-color: var(--accent, #d2edbe); border-radius: 50%; animation: tube-spin 1s linear infinite; }
@keyframes tube-spin { to { transform: rotate(360deg); } }
.tube-skeleton { min-width: 0; }
.tube-skeleton>div { aspect-ratio: 16 / 9; border-radius: 13px; background: #26342c; opacity: .55; }
.tube-skeleton>span, .tube-skeleton>small { display: block; height: 9px; width: 77%; border-radius: 5px; background: #354439; margin-top: 15px; opacity: .45; }
.tube-skeleton>small { width: 43%; height: 6px; margin-top: 9px; }
.tube-state { display: flex; flex-direction: column; align-items: center; padding: 42px 25px 48px; text-align: center; border: 1px solid #d5e5d211; border-radius: 24px; background: linear-gradient(145deg, #27372d45, #18211b20); }
.tube-state-icon { display: grid; place-items: center; width: 65px; height: 65px; border-radius: 22px; color: var(--accent, #d2edbe); background: #a8c8a315; margin-bottom: 21px; }
.tube-state-icon svg { width: 28px; height: 28px; }
.tube-state h3 { font-size: 23px; letter-spacing: -.6px; line-height: 1.3; font-weight: 500; }
.tube-state p { color: #a3b4a8; font-size: 13px; line-height: 1.7; max-width: 480px; margin-top: 12px; }
.tube-state-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 11px; margin-top: 25px; }
.tube-primary, .tube-secondary { display: inline-flex; justify-content: center; align-items: center; gap: 9px; min-height: 42px; border-radius: 10px; padding: 10px 17px; font-size: 12px; font-weight: 550; }
.tube-primary { color: var(--accent-ink, #23351a); background: var(--accent, #d2edbe); }
.tube-primary svg { width: 16px; height: 16px; }
.tube-secondary { color: #bccbbf; background: #ffffff08; border: 1px solid #ffffff12; }
.tube-notice { position: fixed; bottom: 32px; left: 50%; transform: translate(-50%, 12px); z-index: 5; opacity: 0; pointer-events: none; background: #dce9d6; color: #263c2a; max-width: calc(100vw - 50px); padding: 13px 22px; border-radius: 25px; font-size: 13px; line-height: 1.5; box-shadow: 0 8px 35px #0007; transition: opacity .2s, transform .2s; }
.tube-notice.visible { opacity: 1; transform: translate(-50%, 0); }

/* Inline TV keyboard belongs directly to the existing search bar. */
.tube-search-copy { display: flex; align-items: center; min-width: 0; gap: 6px; flex: 1; }
#tube-query { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.tube-query-cursor { display: none; height: 19px; width: 2px; flex-shrink: 0; background: var(--accent, #d2edbe); }
.tube-editing .tube-query-cursor { display: block; }
.tube-editing .tube-top { display: block; margin-bottom: 12px; }
.tube-editing .tube-intro { margin-bottom: 14px; }
.tube-editing .tube-intro h1 { display: none; }
.tube-editing .tube-search-region { width: 100%; min-width: 0; max-width: none; }
.tube-editing .tube-providers { margin-bottom: 9px; }
.tube-editing .tube-search { width: 100%; max-width: none; min-width: 0; border-color: #b6d3b23d; background: #26372c; }
#tube-keyboard { display: grid; grid-template-columns: minmax(0, 1fr) 165px; gap: 18px; width: 100%; margin: 0 0 23px; padding: 17px; border: 1px solid #c5dcc518; border-radius: 18px; background: #1e2b23; }
.tube-keys, .tube-number-keys { display: grid; grid-template-columns: repeat(11, minmax(0, 1fr)); gap: 7px; }
.tube-number-keys { grid-template-columns: repeat(10, minmax(0, 1fr)); margin-top: 10px; }
.tube-keys button, .tube-number-keys button { min-height: 39px; padding: 0; border-radius: 8px; background: #2f4033; color: #dde8dc; font-size: 15px; font-weight: 550; }
.tube-number-keys button { min-height: 32px; background: #28392d; color: #b6c9b8; font-size: 13px; }
.tube-keyboard-actions { display: grid; grid-template-rows: repeat(3, 1fr); gap: 9px; }
.tube-keyboard-actions button { display: flex; align-items: center; justify-content: center; gap: 10px; border-radius: 10px; background: #354a3a; min-height: 39px; font-size: 13px; font-weight: 550; }
.tube-keyboard-actions .tube-keyboard-submit { color: var(--accent-ink, #23351a); background: var(--accent, #d2edbe); }
.tube-keyboard-actions svg { width: 18px; height: 18px; }
#tube-keyboard button:focus-visible, .native-tv #tube-keyboard button:focus { outline: 3px solid #f0f6e9; outline-offset: 3px; color: #213627; background: var(--accent, #d2edbe); }

@media(max-width:1200px) { .tube-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px 17px; } .tube-search-region { min-width: 285px; } .tube-intro h1 { max-width: 460px; } }
@media(max-width:800px) { .tube-top { flex-direction: column; align-items: stretch; gap: 20px; margin-bottom: 20px; } .tube-search { width: 100%; max-width: none; min-width: 0; height: 52px; } .tube-intro h1 { font-size: 34px; margin-top: 12px; } .tube-topics { gap: 7px; } .tube-topic { font-size: 11px; padding: 10px 15px; } .tube-toolbar { padding-bottom: 19px; } .tube-results-heading h2 { font-size: 18px; } .tube-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 25px 14px; } .tube-video-title { font-size: 13px; } .tube-state h3 { font-size: 21px; } .tube-state { padding: 35px 22px; } }
@media(max-width:480px) { .tube-page { padding-top: 20px; } .tube-intro h1 { font-size: 29px; letter-spacing: -1px; } .tube-refresh { display: none; } .tube-results-heading>span { display: none; } .tube-grid { grid-template-columns: 1fr; } #tube-keyboard { grid-template-columns: 1fr; padding: 12px; gap: 12px; } .tube-keyboard-actions { grid-template-columns: repeat(3, 1fr); grid-template-rows: none; } .tube-keys, .tube-number-keys { gap: 5px; } .tube-keys button, .tube-number-keys button { font-size: 12px; min-height: 35px; border-radius: 6px; } .tube-keyboard-actions button { font-size: 11px; } }
@media(max-width:1100px) and (max-height:650px) {
  .native-tv .tube-page { padding-top: 16px; padding-bottom: 32px; }
  .native-tv .tube-top { flex-direction: row; align-items: flex-end; gap: 24px; margin-bottom: 20px; }
  .native-tv .tube-intro h1 { font-size: 31px; letter-spacing: -1.1px; margin-top: 11px; }
  .native-tv .tube-brand { font-size: 9px; }
  .native-tv .tube-brand-mark { width: 25px; height: 19px; }
  .native-tv .tube-search-region { width: 40%; min-width: 290px; }
  .native-tv .tube-providers { margin-bottom: 8px; padding: 3px; border-radius: 10px; }
  .native-tv .tube-providers button { padding: 6px 13px; font-size: 11px; border-radius: 7px; }
  .native-tv .tube-providers button svg { width: 14px; height: 14px; }
  .native-tv .tube-search { width: 100%; min-width: 0; height: 48px; border-radius: 14px; }
  .native-tv .tube-search>span:nth-child(2) { font-size: 12px; }
  .native-tv .tube-toolbar { padding-bottom: 18px; }
  .native-tv .tube-topic { font-size: 11px; padding: 9px 17px; }
  .native-tv .tube-refresh { width: 34px; height: 34px; }
  .native-tv .tube-results-heading { margin: 18px 0 15px; }
  .native-tv .tube-results-heading h2 { font-size: 18px; }
  .native-tv .tube-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 25px 17px; }
  .native-tv .tube-video-title { font-size: 13px; margin-top: 10px; }
  .native-tv .tube-video-meta { font-size: 11px; margin-top: 6px; }
  .native-tv .tube-state { padding: 22px; }
  .native-tv .tube-state-icon { width: 48px; height: 48px; border-radius: 16px; margin-bottom: 14px; }
  .native-tv .tube-state h3 { font-size: 21px; }
  .native-tv .tube-state p { font-size: 12px; margin-top: 9px; }
  .native-tv .tube-state-actions { margin-top: 18px; }
  .native-tv .tube-editing .tube-top { display: block; margin-bottom: 10px; }
  .native-tv .tube-editing .tube-intro { display: none; }
  .native-tv .tube-editing .tube-search-region { width: 100%; min-width: 0; }
  .native-tv .tube-editing .tube-search { width: 100%; min-width: 0; height: 43px; }
  .native-tv #tube-keyboard { width: 100%; grid-template-columns: minmax(0, 1fr) 142px; gap: 14px; padding: 13px; margin-bottom: 16px; }
  .native-tv .tube-keys { gap: 6px; }
  .native-tv .tube-keys button { min-height: 31px; font-size: 14px; }
  .native-tv .tube-number-keys { gap: 6px; margin-top: 8px; }
  .native-tv .tube-number-keys button { min-height: 27px; font-size: 12px; }
  .native-tv .tube-keyboard-actions { gap: 8px; }
  .native-tv .tube-keyboard-actions button { min-height: 33px; font-size: 12px; }
}
@media(max-width:800px) { .tube-search-region { width: 100%; min-width: 0; max-width: none; } .tube-toolbar { flex-wrap: wrap; gap: 12px; } .tube-broadcasters { margin-left: 0; } .tube-refresh { margin-left: auto; } }
@media(prefers-reduced-motion:reduce) { .tube-spinner { animation: none; border-color: var(--accent, #d2edbe); } .tube-page *, #tube-keyboard * { transition: none !important; } }
