/* Standard watch layout from the saved youtube-lofi reference. */
body.mt-chat-layout #app { display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, 412px); gap: 0 24px; padding: 0 24px; align-items: start; }
body.mt-chat-layout .app-header { grid-column: 1 / -1; grid-row: 1; margin: 0 -24px 12px; }
body.mt-chat-layout #mt-idle-stage, body.mt-chat-layout.streaming-active .stream-overlay { grid-column: 1; grid-row: 2; width: 100%; height: auto !important; min-height: 0; max-height: none; aspect-ratio: 16 / 9; margin: 0; border-radius: 12px; overflow: hidden; }
body.mt-chat-layout #mt-watch-meta { grid-column: 1; grid-row: 3; display: block; width: 100%; margin: 16px 0 32px; min-width: 0; }
#mt-watch-sidebar { grid-column: 2; grid-row: 2 / 4; min-width: 0; }
#mt-watch-sidebar .mt-up-next { display: flex; padding-top: 24px; }
#mt-watch-sidebar .mt-thumb { width: 48%; }
#mt-watch-sidebar .mt-rec-copy strong { font-size: 14px; }
#mt-watch-sidebar .mt-rec-copy > span { font-size: 12px; }
body.mt-chat-layout .mt-channel-row { flex-wrap: wrap; height: auto; gap: 10px; }
body.mt-chat-layout #mt-watch-title { font-size: 20px; }
body.mt-chat-layout .mt-channel-copy strong { font-size: 16px; }
body.mt-chat-layout .mt-channel-copy > span { font-size: 12px; }
body.mt-chat-layout .mt-description { font-size: 14px; }
body.mt-chat-layout .mt-avatar, body.mt-chat-layout .mt-round { width: 40px; height: 40px; }
body.mt-chat-layout .mt-subscribe, body.mt-chat-layout .mt-reactions { height: 40px; font-size: 14px; }
body.mt-chat-layout .mt-idle-controls, body.mt-chat-layout .mt-player-controls, body.mt-chat-layout .stream-header { height: 56px; }
body.mt-chat-layout .mt-chapter { display: none; }
#mt-live-chat { height: min(598px, calc(100dvh - 100px)); min-height: 420px; display: flex; flex-direction: column; border: 1px solid #ffffff33; border-radius: 12px; overflow: hidden; background: #0f0f0f; color: #f1f1f1; font: 13px/1.5 Arial, sans-serif; }
.mt-chat-heading { min-height: 54px; padding: 8px 20px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid #ffffff26; font-size: 16px; }
.mt-chat-heading > span > span { margin-left: 9px; }
.mt-chat-heading button { border: 0; color: inherit; background: transparent; font-size: 24px; padding: 0 8px; }
.mt-chat-messages { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 12px 16px; scrollbar-width: thin; }
.mt-chat-line { display: flex; align-items: flex-start; gap: 10px; padding: 6px 0; overflow-wrap: anywhere; }
.mt-chat-line > span:last-child { min-width: 0; }
.mt-chat-line strong { color: #aaa; margin-right: 5px; font-size: 13px; font-weight: 500; }
.mt-chat-own strong { color: #f1c75b; }
.mt-chat-avatar { display: inline-grid; place-items: center; width: 24px; height: 24px; flex-shrink: 0; border-radius: 50%; background: #375d72; color: white; font-size: 12px; }
.mt-chat-compose { border-top: 1px solid #ffffff26; padding: 12px 20px 10px; }
.mt-chat-identity { display: flex; align-items: center; gap: 10px; color: #aaa; margin-bottom: 8px; }
.mt-chat-compose input { display: block; width: 100%; background: transparent; color: #f1f1f1; border: 0; border-bottom: 1px solid #555; padding: 6px 0; outline: none; font-size: 14px; }
.mt-chat-compose input:focus { border-bottom-color: #3ea6ff; }
.mt-chat-compose-actions { display: flex; align-items: center; gap: 16px; padding-top: 8px; }
.mt-chat-compose-actions > span:first-child { font-size: 24px; }
.mt-chat-count { margin-left: auto; color: #aaa; font-size: 12px; }
.mt-chat-compose-actions button { background: transparent; border: 0; color: #aaa; font-size: 23px; padding: 0 2px; }
.mt-chat-info { padding: 12px 20px; background: #272727; font-size: 12px; }
.mt-comments { margin-top: 24px; }
.mt-comments .mt-chat-avatar { width: 40px; height: 40px; font-size: 18px; }
.mt-comments .mt-notes .mt-chat-line { padding: 14px 0; }
.mt-comments .mt-notes strong { display: block; color: #f1f1f1; font-weight: 600; }
#mt-watch-meta .mt-comments button { cursor: pointer; }
body.mt-chat-layout.streaming-active .stream-overlay:fullscreen, body.mt-chat-layout.streaming-active .stream-overlay.stream-css-fs { height: 100dvh !important; border-radius: 0; aspect-ratio: auto; }
@media (max-width: 1050px) {
    body.mt-chat-layout #app { grid-template-columns: minmax(0,1fr) 320px; gap: 0 16px; padding: 0 16px; }
    body.mt-chat-layout .app-header { margin-left: -16px; margin-right: -16px; }
    body.mt-chat-layout .mt-subscribe { margin-left: 0; }
}
@media (max-width: 800px) {
    body.mt-chat-layout #app { display: flex; padding: 0; gap: 0; }
    body.mt-chat-layout .app-header { order: 0; margin: 0; }
    body.mt-chat-layout #mt-idle-stage, body.mt-chat-layout.streaming-active .stream-overlay { order: 1; border-radius: 0; }
    body.mt-chat-layout #mt-watch-sidebar { order: 2; width: calc(100% - 28px); margin: 14px; }
    body.mt-chat-layout #mt-live-chat { width: 100%; height: 420px; min-height: 0; }
    body.mt-chat-layout #mt-watch-meta { order: 3; width: calc(100% - 28px); margin: 0 14px 28px; }
}

.mt-description a { color: #3ea6ff; text-decoration: none; }
.mt-comments h3 .mt-comment-total { margin: 0; font-size: inherit; }
.mt-comment-thread { margin: 10px 0 22px; }
.mt-comment-age { font-weight: 400; color: #aaa; font-size: 12px; margin-left: 8px; }
.mt-comment-actions { display: flex; gap: 22px; margin: 0 0 4px 50px; font-size: 12px; color: #ccc; }
.mt-comment-replies { margin-left: 50px; }
.mt-comment-replies summary { cursor: pointer; color: #3ea6ff; padding: 8px 0; font-size: 14px; }
.mt-comment-replies .mt-chat-avatar { width: 24px; height: 24px; font-size: 12px; }
.mt-comment-replies .mt-chat-line { font-size: 14px; }

/* Watch-page density at normal browser zoom, shared by both layouts. */
.app-header, body.streaming-active .app-header { height: 56px; padding: 0 16px; gap: 16px; }
.app-header > .mt-icon-button { width: 40px; }
.app-header h1 { width: 112px; }
.app-header h1 img { width: 93px; height: 20px; }
.app-header h1 sup { top: -5px; right: 2px; font-size: 10px; }
.mt-search { width: min(44vw, 640px); height: 40px; }
.mt-search input { font-size: 16px; padding-left: 16px; }
.mt-search button { width: 64px; flex-shrink: 0; }
.mt-search button svg, .mt-signin svg { width: 24px; height: 24px; }
.mt-mic { width: 40px; height: 40px; margin-left: 0; }
.mt-signin { height: 36px; font-size: 14px; font-weight: 500; padding: 0 10px; }
#mt-navigation { top: 56px; }
#mt-watch-meta { width: calc(100% - 48px); max-width: 1754px; margin: 16px auto 32px; grid-template-columns: minmax(0, 1fr) 402px; gap: 24px; }
#mt-watch-title { font-size: 20px; line-height: 28px; margin-bottom: 12px; }
.mt-channel-row { gap: 12px; height: auto; min-height: 40px; flex-wrap: wrap; margin-bottom: 12px; }
.mt-avatar { width: 40px; height: 40px; }
.mt-channel-copy { gap: 2px; }
.mt-channel-copy strong { font-size: 16px; line-height: 22px; }
.mt-channel-copy > span { font-size: 12px; line-height: 18px; }
.mt-channel-copy .mt-verified { color: #161616; font-size: 10px; line-height: 13px; }
.mt-subscribe, body.mt-chat-layout .mt-subscribe { height: 36px; padding: 0 16px; margin-left: 12px; font-size: 14px; }
.mt-reactions, body.mt-chat-layout .mt-reactions { height: 36px; }
.mt-reactions button { font-size: 14px; height: 24px; gap: 8px; padding: 0 12px; }
.mt-reactions svg { width: 24px; height: 24px; }
.mt-round, body.mt-chat-layout .mt-round { width: 36px; height: 36px; padding: 6px; border: 0; }
.mt-round svg { width: 24px; height: 24px; }
.mt-description { padding: 12px; font-size: 14px; line-height: 20px; }
.mt-description summary { list-style: none; }
.mt-description strong { font-weight: 600; }
.mt-description p { margin: 4px 0; }
.mt-up-next { display: flex; gap: 8px; padding-top: 0; }
.mt-chips { display: flex; margin: 0 0 8px; overflow: hidden; white-space: nowrap; }
.mt-chips span { padding: 7px 12px; font-weight: 500; }
.mt-recommendation { gap: 8px; }
.mt-thumb, #mt-watch-sidebar .mt-thumb { width: 168px; max-width: 44%; }
.mt-thumb img { border-radius: 8px; }
.mt-thumb > span { font-size: 12px; padding: 1px 4px; bottom: 4px; right: 4px; font-weight: 600; }
.mt-rec-copy { gap: 2px; min-width: 0; padding-top: 0; }
.mt-rec-copy strong, #mt-watch-sidebar .mt-rec-copy strong { font-size: 14px; line-height: 20px; font-weight: 600; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin: 0 0 2px; }
.mt-rec-copy > span { font-size: 12px; line-height: 18px; }
.mt-rec-more { font-size: 22px; line-height: 24px; }
.mt-idle-controls, .mt-player-controls, .stream-overlay .stream-header,
body.mt-chat-layout .mt-idle-controls, body.mt-chat-layout .mt-player-controls, body.mt-chat-layout .stream-header { height: 48px; }
.mt-idle-controls { border-top-width: 3px; gap: 16px; padding: 0 4px; left: 12px; right: 12px; }
.mt-idle-controls svg, .mt-player-controls .mt-icon-button svg { width: 24px; height: 24px; }
.mt-idle-live, .mt-live-label, .mt-chapter { font-size: 13px; font-weight: 500; }
.mt-live-label::before { display: inline-block; width: 8px; height: 8px; }
.mt-live-line { height: 3px; }
.mt-live-line span { width: 9px; height: 9px; }
.mt-player-controls { gap: 8px; }
.mt-chapter { margin-left: 8px; }
body.mt-chat-layout #app { max-width: 1802px; margin: 0 auto; }
body.mt-chat-layout .app-header { margin-bottom: 24px; }
#mt-live-chat { font-family: Arial, Helvetica, sans-serif; }
.mt-chat-heading { min-height: 48px; padding: 8px 16px; }
.mt-chat-heading > span { display: flex; align-items: center; gap: 8px; }
.mt-chat-heading svg, .mt-chat-compose-actions svg { width: 24px; height: 24px; display: block; }
.mt-chat-heading button { padding: 4px; border-radius: 50%; }
.mt-chat-messages { padding: 8px 16px; scrollbar-color: #717171 transparent; }
.mt-chat-line { padding: 4px 0; gap: 8px; line-height: 20px; }
.mt-chat-line strong { font-weight: 500; }
.mt-chat-compose { padding: 12px 16px 8px; }
.mt-chat-compose input { padding: 4px 0 7px; font-size: 13px; }
.mt-chat-compose-actions { padding-top: 8px; }
.mt-chat-compose-actions button { padding: 4px; }
.mt-chat-compose-actions button:hover { color: #f1f1f1; }
.mt-comments h3 { display: flex; align-items: center; gap: 6px; font-size: 20px; font-weight: 600; }
.mt-comments h3 .mt-comment-sort { display: inline-flex; gap: 8px; align-items: center; margin-left: 24px; font-size: 14px; font-weight: 500; }
.mt-comments h3 svg { width: 24px; height: 24px; }
.mt-comment-thread { margin: 0 0 16px; }
.mt-comments .mt-notes .mt-chat-line { padding: 8px 0; gap: 16px; line-height: 20px; }
.mt-comments .mt-notes strong { margin-bottom: 2px; font-size: 13px; }
.mt-comments .mt-notes { font-size: 14px; }
.mt-comment-actions { margin-left: 56px; align-items: center; gap: 18px; height: 32px; color: #f1f1f1; }
.mt-comment-actions span { display: inline-flex; align-items: center; gap: 6px; }
.mt-comment-actions svg { width: 20px; height: 20px; }
.mt-comment-replies { margin-left: 56px; }
.mt-comment-replies summary { font-weight: 600; padding: 8px 12px; width: fit-content; border-radius: 20px; }
.mt-comment-replies summary:hover { background: #263850; }
.mt-comment-age { font-size: 12px; }
@media (max-width: 1100px) {
    #mt-watch-meta { grid-template-columns: minmax(0, 1fr) 320px; }
    .mt-channel-row { gap: 8px; }
    .mt-subscribe, body.mt-chat-layout .mt-subscribe { margin-left: 0; }
}
@media (max-width: 800px) {
    #mt-watch-meta { grid-template-columns: 1fr; width: calc(100% - 28px); margin: 14px; }
    .app-header, body.streaming-active .app-header { gap: 8px; padding: 0 8px; }
    .app-header h1 { margin-right: auto; }
    body.mt-chat-layout .app-header { margin-bottom: 0; }
    .mt-mic { margin-right: 0; }
    .mt-channel-row .mt-control-spacer { flex-basis: 100%; height: 0; }
    .mt-reactions { margin-left: 0; }
    #mt-watch-title { font-size: 18px; line-height: 26px; }
}
@media (max-width: 380px) { .mt-mic { display: none; } }
