/* GoodTvTube.com -- one stylesheet, phone first.  Light / dark: html.dark / html.light, else the device. */
/* Light / dark as EaglePress does it: <html data-theme="light|dark">, set before paint by the inline anti-FOUC
   script (localStorage gtt_theme, light by default), toggle emoji shows the CURRENT mode (☀️ light / 🌙 dark).
   Every text colour meets WCAG 2.1 AA (4.5:1) on the surfaces it is used on; dark palette = EaglePress's
   GitHub-style dark (#0d1117 / #161b22 / #e6edf3 / #8b949e / #30363d). */
:root, [data-theme="light"] {
    --bg: #ffffff; --bg2: #f6f8fa; --surface: #ffffff; --surface2: #eef1f4; --border: #d0d7de;
    --text: #1f2328; --muted: #59636e; --faint: #656d76; --accent: #cf222e; --accent2: #ff8a00;
    --link: #0969da; --ok: #116329; --warn: #7d4e00; --err: #cf222e;
    --input-bg: #ffffff; --input-border: #6e7781; --focus: #0969da;
    --shadow: 0 6px 24px rgba(31, 35, 40, .12); --radius: 14px; --top: 56px; --side: 240px; --bottom: 0px;
    color-scheme: light;
}
[data-theme="dark"] {
    --bg: #0d1117; --bg2: #161b22; --surface: #161b22; --surface2: #21262d; --border: #30363d;
    --text: #e6edf3; --muted: #8b949e; --faint: #8b949e; --accent: #ff5a5f; --accent2: #ffa040;
    --link: #58a6ff; --ok: #3fb950; --warn: #d29922; --err: #f85149;
    --input-bg: #010409; --input-border: #6e7681; --focus: #58a6ff;
    --shadow: 0 8px 28px rgba(0, 0, 0, .55);
    color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body { font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; -webkit-tap-highlight-color: transparent;
       padding-bottom: var(--bottom); }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
button, input, textarea, select { font: inherit; color: inherit; }

/* ---------- top bar ---------- */
.top { position: fixed; inset: 0 0 auto 0; height: var(--top); z-index: 50; display: flex; align-items: center; gap: 8px;
       padding: 0 12px; padding-left: max(12px, env(safe-area-inset-left)); padding-right: max(12px, env(safe-area-inset-right));
       background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); }
.icon-btn { width: 40px; height: 40px; border-radius: 50%; border: 0; background: none; display: grid; place-items: center;
            cursor: pointer; color: var(--text); flex: none; }
.icon-btn:hover { background: var(--surface2); }
.logo { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 19px; letter-spacing: -.3px; white-space: nowrap; }
.logo-mark { width: 30px; height: 22px; border-radius: 7px; display: grid; place-items: center; color: #fff; font-size: 12px;
             background: linear-gradient(135deg, var(--accent), var(--accent2)); box-shadow: 0 2px 8px rgba(255, 61, 61, .35); }
.logo-text b { color: var(--accent); }
.search { flex: 1; max-width: 620px; margin: 0 auto; display: flex; height: 40px; }
.search input { flex: 1; min-width: 0; border: 1px solid var(--border); border-right: 0; border-radius: 999px 0 0 999px;
                background: var(--bg); padding: 0 16px; outline: none; }
.search input:focus { border-color: var(--link); }
.search button { width: 64px; border: 1px solid var(--border); border-radius: 0 999px 999px 0; background: var(--surface2);
                 display: grid; place-items: center; cursor: pointer; }
.top-right { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.search-open { display: none; }
.theme-btn::before { content: '☀️'; font-size: 19px; line-height: 1; }
[data-theme="dark"] .theme-btn::before { content: '🌙'; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 38px; padding: 0 16px; border-radius: 999px;
       border: 1px solid transparent; background: var(--text); color: var(--bg); font-weight: 600; cursor: pointer; white-space: nowrap; }
.btn:hover { opacity: .9; }
.btn.ghost { background: var(--surface2); color: var(--text); }
.btn.sm { height: 32px; padding: 0 12px; font-size: 13px; }
.btn.wide { width: 100%; height: 44px; }
.btn.signin { background: none; color: var(--link); border-color: var(--border); }
.btn:disabled { opacity: .5; cursor: default; }
.acct { position: relative; }
.avatar { width: 34px; height: 34px; border-radius: 50%; border: 0; cursor: pointer; color: #fff; font-weight: 700;
          background: linear-gradient(135deg, #7b5cff, #2fb5ff); }
.acct-menu { position: absolute; right: 0; top: 44px; min-width: 220px; background: var(--surface); border: 1px solid var(--border);
             border-radius: 12px; box-shadow: var(--shadow); padding: 6px; z-index: 60; }
.acct-menu a { display: block; padding: 10px 12px; border-radius: 8px; }
.acct-menu a:hover { background: var(--surface2); }
.acct-name { padding: 10px 12px; font-weight: 700; border-bottom: 1px solid var(--border); margin-bottom: 4px; }
.acct-name small { display: block; font-weight: 400; color: var(--muted); }

/* ---------- sidebar (drawer on smaller screens) ---------- */
.shell { padding-top: var(--top); }
.side { position: fixed; top: var(--top); bottom: 0; left: 0; width: var(--side); overflow-y: auto; padding: 10px 10px 30px;
        background: var(--bg); z-index: 40; scrollbar-width: thin; transform: translateX(-100%); transition: transform .22s ease; }
.side a { display: flex; align-items: center; gap: 16px; height: 42px; padding: 0 12px; border-radius: 10px; font-size: 14.5px; }
.side a:hover { background: var(--surface2); }
.side a.on { background: var(--surface2); font-weight: 700; }
.side .ci { width: 22px; text-align: center; font-size: 17px; }
.side-head { margin: 14px 12px 4px; padding-top: 12px; border-top: 1px solid var(--border); color: var(--muted);
             font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; }
.side .all { color: var(--link); }
.side-foot { margin: 18px 12px 0; color: var(--faint); font-size: 12px; }
body.drawer .side { transform: none; box-shadow: var(--shadow); }
.scrim { position: fixed; inset: var(--top) 0 0 0; background: rgba(0, 0, 0, .45); z-index: 35; display: none; }
body.drawer .scrim { display: block; }
.main { padding: 14px 16px 40px; padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right));
        min-height: calc(100vh - var(--top)); }
@media (min-width: 1100px) {
    .side { transform: none; }
    .menu-btn { display: none; }
    .main { margin-left: var(--side); padding: 18px 28px 48px; }
    .scrim { display: none !important; }
}

/* ---------- bottom navigation (phones) ---------- */
.bottom-nav { display: none; }
@media (max-width: 700px) {
    :root { --bottom: calc(58px + env(safe-area-inset-bottom)); }
    .bottom-nav { display: flex; position: fixed; inset: auto 0 0 0; height: var(--bottom); padding-bottom: env(safe-area-inset-bottom);
                  background: color-mix(in srgb, var(--bg) 94%, transparent); backdrop-filter: blur(10px);
                  border-top: 1px solid var(--border); z-index: 50; }
    .bottom-nav a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
                    font-size: 11px; color: var(--muted); }
    .bottom-nav a.on { color: var(--text); font-weight: 700; }
    .bottom-nav .bn-up svg { background: linear-gradient(135deg, var(--accent), var(--accent2)); color: #fff; border-radius: 10px;
                             padding: 4px; width: 34px; height: 26px; }
    .top { gap: 2px; }
    .search { display: none; }
    .search-open { display: grid; }
    .up-btn, .theme-btn { display: none; }
    body.searching .search { display: flex; position: absolute; inset: 8px 10px; max-width: none; z-index: 2; }
    body.searching .logo, body.searching .top-right, body.searching .menu-btn { visibility: hidden; }
    .main { padding: 10px 0 30px; }
}

/* ---------- category chips ---------- */
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 12px; scrollbar-width: none; position: sticky; top: var(--top);
         background: var(--bg); z-index: 5; }
.chips::-webkit-scrollbar { display: none; }
.chips a { flex: none; height: 34px; padding: 0 14px; display: flex; align-items: center; border-radius: 10px; background: var(--surface2);
           font-size: 14px; font-weight: 500; }
.chips a.on { background: var(--text); color: var(--bg); }
@media (max-width: 700px) { .chips { padding: 6px 12px 10px; } }

/* ---------- video grid and cards ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 26px 16px; }
@media (min-width: 1600px) { .grid { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); } }
@media (max-width: 700px) { .grid { grid-template-columns: 1fr; gap: 18px; }
                            .vcard .meta { padding: 0 12px; } .vcard .thumb { border-radius: 0; } }
@media (min-width: 701px) and (max-width: 900px) { .grid { grid-template-columns: repeat(2, 1fr); } }
.vcard { min-width: 0; }
.thumb { position: relative; display: block; aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden; background: var(--surface2); }
.thumb img, .thumb video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
/* the preview video sits UNDER the image; the image is only hidden once the video has painted a frame */
.thumb video { z-index: 1; background: transparent; }
.thumb img { z-index: 2; }
.thumb.playing img { visibility: hidden; }
.dur { position: absolute; right: 8px; bottom: 8px; padding: 2px 6px; border-radius: 6px; background: rgba(0, 0, 0, .78); color: #fff;
       font-size: 12px; font-weight: 600; z-index: 2; }
.thumb.playing .dur { opacity: 0; }
.meta { display: flex; flex-direction: column; gap: 2px; padding-top: 10px; }
.meta .title { font-weight: 650; font-size: 15.5px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
               overflow: hidden; }
.meta .chan, .meta .stats { color: var(--muted); font-size: 13.5px; }
.meta a.chan:hover { color: var(--text); }
.more-row { text-align: center; margin: 30px 0 10px; }
.more { height: 44px; padding: 0 28px; }
.more-note { color: var(--muted); margin-top: 10px; }
.empty { color: var(--muted); padding: 30px 6px; text-align: center; }
.empty.big h1 { font-size: 64px; margin: 0; }
.page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin: 6px 0 18px; }
.page-head h1 { margin: 0; font-size: 26px; }
.page-head .sub { width: 100%; margin: 0; color: var(--muted); }
@media (max-width: 700px) { .page-head { padding: 0 12px; } .page-head h1 { font-size: 22px; } }
.h2 { font-size: 19px; margin: 24px 0 12px; }
.note { color: var(--muted); }
.note a, .w-text a, .form a { color: var(--link); }
.warn { background: rgba(199, 119, 0, .12); color: var(--warn); padding: 8px 12px; border-radius: 10px; }

/* ---------- categories page ---------- */
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.cat-tile { display: flex; flex-direction: column; gap: 4px; padding: 18px; border-radius: var(--radius); background: var(--surface2); }
.cat-tile:hover { outline: 2px solid var(--border); }
.ct-icon { font-size: 28px; }
.ct-name { font-weight: 700; }
.ct-n { color: var(--muted); font-size: 13px; }
.tag-cloud { display: flex; flex-wrap: wrap; gap: 8px; }
.tag { display: inline-flex; align-items: center; gap: 4px; padding: 6px 12px; border-radius: 999px; background: var(--surface2); font-size: 13.5px; }
.tag small { color: var(--faint); }
.tag.prim { background: color-mix(in srgb, var(--accent) 14%, var(--surface2)); }
@media (max-width: 700px) { .cat-grid, .tag-cloud, .h2 { margin-left: 12px; margin-right: 12px; } }

/* ---------- watch page ---------- */
.watch { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; max-width: 1700px; margin: 0 auto; }
@media (min-width: 1000px) { .watch { grid-template-columns: minmax(0, 1fr) 380px; } }
.player-wrap { position: relative; background: #000; border-radius: var(--radius); overflow: hidden; aspect-ratio: 16 / 9; }
.player-wrap video { width: 100%; height: 100%; display: block; background: #000; }
@media (max-width: 700px) { .player-wrap { border-radius: 0; position: sticky; top: var(--top); z-index: 6; }
                            .w-title, .w-bar, .comments { padding-left: 12px; padding-right: 12px; }
                            .w-desc { margin-left: 12px; margin-right: 12px; } .comments .h2 { margin-left: 0; } }
.w-title { font-size: 21px; line-height: 1.3; margin: 14px 0 10px; }
.w-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.w-owner { display: flex; align-items: center; gap: 14px; }
.w-chan { display: flex; align-items: center; gap: 10px; }
.w-chan small { display: block; color: var(--muted); font-size: 12.5px; font-weight: 400; }
.mini-av { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 700;
           background: linear-gradient(135deg, #7b5cff, #2fb5ff); flex: none; }
.w-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.likes { display: flex; background: var(--surface2); border-radius: 999px; overflow: hidden; }
.likes button { border: 0; background: none; height: 38px; padding: 0 14px; cursor: pointer; font-weight: 600; }
.likes button + button { border-left: 1px solid var(--border); }
.likes button.on { color: var(--link); }
.sub-btn.on { background: var(--surface2); color: var(--text); }
.w-desc { background: var(--surface2); border-radius: var(--radius); padding: 12px 14px; margin-top: 14px; }
.w-stats { font-weight: 600; margin: 0 0 6px; }
.w-text { white-space: normal; overflow-wrap: anywhere; }
.w-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.w-side .up-next { margin-top: 0; }
.next { display: grid; grid-template-columns: 168px 1fr; gap: 10px; margin-bottom: 12px; }
.next .thumb { border-radius: 10px; }
.n-meta { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.n-meta b { font-size: 14px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.n-meta small { color: var(--muted); font-size: 12.5px; }
@media (max-width: 999px) { .w-side { padding: 0 12px; } }

/* ---------- comments (nested, as chatddit) ---------- */
.c-form { display: flex; flex-direction: column; gap: 8px; margin-bottom: 18px; }
.c-form textarea, .reply-form textarea { width: 100%; resize: vertical; min-height: 42px; border: 0; border-bottom: 1px solid var(--border);
                                         background: transparent; padding: 8px 2px; outline: none; }
.c-form textarea:focus, .reply-form textarea:focus { border-color: var(--text); }
.c-form-act { display: none; justify-content: flex-end; gap: 8px; }
.c-form.active .c-form-act, .reply-form .c-form-act { display: flex; }
.cm { display: grid; grid-template-columns: 36px 1fr; gap: 10px; margin: 14px 0; }
.cm .mini-av { width: 36px; height: 36px; font-size: 14px; }
.cm-head { font-size: 13px; color: var(--muted); }
.cm-head b { color: var(--text); margin-right: 6px; }
.cm-body { margin: 2px 0 4px; overflow-wrap: anywhere; white-space: pre-wrap; }
.cm-act { display: flex; gap: 4px; }
.cm-act button { border: 0; background: none; color: var(--muted); font-weight: 600; font-size: 13px; padding: 4px 8px; border-radius: 999px; cursor: pointer; }
.cm-act button:hover { background: var(--surface2); color: var(--text); }
.cm-kids { border-left: 2px solid var(--border); padding-left: 12px; margin-left: 4px; }
.cm.collapsed > div > .cm-body, .cm.collapsed > div > .cm-act, .cm.collapsed > div > .cm-kids { display: none; }
.cm-deleted { color: var(--faint); font-style: italic; }

/* ---------- channel ---------- */
.ch-banner { height: 170px; border-radius: var(--radius); background: linear-gradient(120deg, #ff3d3d, #ff8a00 45%, #7b5cff); background-size: cover; background-position: center; }
.ch-head { display: flex; flex-wrap: wrap; align-items: center; gap: 18px; margin: 18px 0 24px; }
.ch-avatar { width: 96px; height: 96px; border-radius: 50%; display: grid; place-items: center; font-size: 40px; font-weight: 800; color: #fff;
             background: linear-gradient(135deg, #7b5cff, #2fb5ff); flex: none; }
.ch-info { flex: 1; min-width: 200px; }
.ch-info h1 { margin: 0; font-size: 28px; }
.ch-info .sub { margin: 4px 0; color: var(--muted); }
.ch-about { margin: 4px 0 0; }
.ch-act { display: flex; gap: 8px; }
@media (max-width: 700px) { .ch-banner { border-radius: 0; height: 110px; } .ch-head { padding: 0 12px; gap: 12px; }
                            .ch-avatar { width: 64px; height: 64px; font-size: 28px; } .ch-info h1 { font-size: 22px; } }

/* ---------- forms ---------- */
.auth { max-width: 420px; margin: 30px auto; padding: 0 16px; }
.form, .upload { display: flex; flex-direction: column; gap: 14px; max-width: 640px; }
.auth .form { max-width: none; }
.form label, .upload label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: 14px; }
.form small, .upload small { font-weight: 400; color: var(--muted); }
.form input, .form textarea, .upload input:not([type=file]):not([type=checkbox]), .upload textarea {
    border: 1px solid var(--border); background: var(--bg); border-radius: 10px; padding: 11px 12px; outline: none; font-weight: 400; }
.form input:focus, .form textarea:focus, .upload input:focus, .upload textarea:focus { border-color: var(--link); }
.form.inline { flex-direction: row; flex-wrap: wrap; align-items: center; max-width: none; margin-bottom: 14px; }
.form.inline input { flex: 1; min-width: 180px; }
.form-msg { margin: 0; min-height: 1.2em; color: var(--err); }
.form-msg.ok { color: var(--ok); }
.cats { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; display: flex; flex-wrap: wrap; gap: 6px 14px; }
.cats legend { font-weight: 600; font-size: 14px; padding: 0 4px; }
.chk { flex-direction: row !important; align-items: center; gap: 6px !important; font-weight: 400 !important; }
.drop { position: relative; border: 2px dashed var(--border); border-radius: var(--radius); padding: 34px 16px; text-align: center; }
.drop.over { border-color: var(--link); background: color-mix(in srgb, var(--link) 8%, transparent); }
.drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.drop-text small { display: block; color: var(--muted); margin-top: 6px; }
.drop-file { margin-top: 8px; font-weight: 600; }
.progress .bar { height: 10px; border-radius: 999px; background: var(--surface2); overflow: hidden; }
.progress .bar span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--accent2)); transition: width .2s; }
@media (max-width: 700px) { .form, .upload { padding: 0 12px; } }

/* ---------- studio / admin ---------- */
.tabs { display: flex; gap: 6px; overflow-x: auto; margin-bottom: 18px; scrollbar-width: none; }
.tabs a { flex: none; padding: 8px 14px; border-radius: 999px; background: var(--surface2); font-weight: 600; font-size: 14px; }
.tabs a.on { background: var(--text); color: var(--bg); }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.tile { background: var(--surface2); border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; }
.tile b { font-size: 28px; }
.tile span { color: var(--muted); }
.table-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; }
.tbl td, .tbl th { padding: 10px 8px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: middle; }
.tbl th { color: var(--muted); font-size: 13px; }
.tbl img { width: 120px; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 8px; }
.tbl small { display: block; color: var(--muted); }
.st { display: inline-block; padding: 1px 8px; border-radius: 999px; background: var(--surface2); font-size: 12px; font-weight: 600; }
.st-done { color: var(--ok); } .st-failed { color: var(--err); } .st-converting, .st-received { color: var(--warn); }
.pending { padding-left: 18px; }
@media (max-width: 700px) { .tabs, .tiles, .table-wrap, .pending { margin-left: 12px; margin-right: 12px; } .tbl img { width: 90px; } }

/* ---------- thumbnail picker ---------- */
.edit { display: grid; gap: 28px; }
@media (min-width: 1100px) { .edit { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); } }
.tp-stage { position: relative; display: grid; grid-template-columns: 2fr 1fr; gap: 10px; align-items: start; }
.tp-stage video { width: 100%; aspect-ratio: 16 / 9; background: #000; border-radius: var(--radius); }
.tp-stage img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 10px; outline: 2px solid var(--border); }
#tp-range { width: 100%; margin: 12px 0 6px; accent-color: var(--accent); }
.tp-row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; }
.tp-row > div { display: flex; gap: 6px; flex-wrap: wrap; }
.filmstrip { display: grid; grid-template-columns: repeat(10, 1fr); gap: 4px; margin-top: 10px; }
.filmstrip canvas { width: 100%; aspect-ratio: 16 / 9; border-radius: 6px; cursor: pointer; background: var(--surface2); }
.filmstrip canvas:hover { outline: 2px solid var(--accent); }
@media (max-width: 700px) { .thumb-pick { padding: 0 12px; } .tp-stage { grid-template-columns: 1fr; } .filmstrip { grid-template-columns: repeat(5, 1fr); } }

.toast { position: fixed; left: 50%; bottom: calc(var(--bottom) + 18px); transform: translateX(-50%); background: var(--text); color: var(--bg);
         padding: 10px 18px; border-radius: 999px; z-index: 100; font-weight: 600; box-shadow: var(--shadow); }

/* ---------- pictures: avatars, channel banner, channel page background ---------- */
.has-img { padding: 0 !important; overflow: hidden; background: var(--surface2) !important; }
.has-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
button.ch-avatar { border: 0; cursor: pointer; position: relative; }
button.ch-avatar::after { content: '📷'; position: absolute; inset: auto 0 0 0; height: 32%; display: grid; place-items: center;
                          font-size: 18px; background: rgba(0, 0, 0, .55); opacity: 0; transition: opacity .15s; }
button.ch-avatar:hover::after, button.ch-avatar:focus-visible::after { opacity: 1; }
.ch-banner { position: relative; }
.ch-edit-banner, .ch-edit-bg { position: absolute; bottom: 12px; background: rgba(0, 0, 0, .62) !important; color: #fff !important; }
.ch-edit-banner { right: 12px; } .ch-edit-bg { right: 168px; }
@media (max-width: 700px) { .ch-edit-bg { right: auto; left: 12px; } }
.pictures { max-width: 720px; margin-bottom: 26px; }
.pictures .h2 { margin-left: 0; }
.av-row { display: flex; align-items: center; gap: 18px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.av-row .ch-avatar { width: 84px; height: 84px; font-size: 34px; }
.av-row .note { margin: 2px 0 8px; }
.pv { flex: none; width: 150px; height: 84px; border-radius: 10px; background: linear-gradient(120deg, #ff3d3d, #ff8a00 45%, #7b5cff);
      background-size: cover; background-position: center; outline: 1px solid var(--border); }
.pv-banner { height: 38px; }
.note.small { font-size: 13px; }
@media (max-width: 700px) { .pictures { padding: 0 12px; } .av-row { gap: 12px; } .pv { width: 96px; height: 54px; } .pv-banner { height: 24px; } }
.uploading { opacity: .55; pointer-events: none; }

/* a channel's own page background, under a veil of the page colour so all text keeps its contrast */
body.has-page-bg { background: transparent; }
html:has(body.has-page-bg) { background: var(--bg); }
body.has-page-bg::before { content: ''; position: fixed; inset: 0; z-index: -1;
    background: linear-gradient(color-mix(in srgb, var(--bg) 80%, transparent), color-mix(in srgb, var(--bg) 80%, transparent)),
                var(--page-bg) center / cover no-repeat; }
body.has-page-bg .chips, body.has-page-bg .side { background: color-mix(in srgb, var(--bg) 92%, transparent); }

/* ---------- phone front page: one screen with only the search; videos (and their previews) start below it ---------- */
.home-intro { display: none; }
@media (max-width: 700px) {
    .home-intro { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; text-align: center;
                  min-height: calc(100svh - var(--top) - var(--bottom)); padding: 24px 20px 30px; margin-top: -10px; }
    .hi-logo { display: flex; align-items: center; gap: 10px; font-size: 34px; font-weight: 800; letter-spacing: -.5px; }
    .hi-logo .logo-mark { width: 52px; height: 38px; border-radius: 12px; font-size: 20px; }
    .hi-logo b { color: var(--accent); }
    .hi-tag { margin: 0 0 8px; color: var(--muted); }
    .hi-search { display: flex; width: 100%; max-width: 440px; height: 50px; }
    .hi-search input { flex: 1; min-width: 0; border: 1px solid var(--border); border-right: 0; border-radius: 999px 0 0 999px;
                       background: var(--bg); padding: 0 18px; font-size: 16px; outline: none; }
    .hi-search input:focus { border-color: var(--link); }
    .hi-search button { width: 62px; border: 1px solid var(--border); border-radius: 0 999px 999px 0; background: var(--surface2);
                        display: grid; place-items: center; }
    .hi-count { margin: 0; color: var(--muted); font-size: 14px; }
    .hi-down { margin-top: 28px; display: flex; flex-direction: column; align-items: center; gap: 2px; color: var(--muted); font-size: 13px; }
    .hi-down svg { width: 30px; height: 30px; animation: hi-bob 1.6s ease-in-out infinite; }
    @keyframes hi-bob { 50% { transform: translateY(6px); } }
    #feed { scroll-margin-top: var(--top); }
}
@media (max-width: 700px) and (prefers-reduced-motion: reduce) { .hi-down svg { animation: none; } }

.rotate-box { grid-column: 1 / -1; border-top: 1px solid var(--border); padding-top: 4px; }
.rot-row { display: flex; flex-wrap: wrap; gap: 8px; }
.rot-msg { min-height: 1.3em; color: var(--muted); }
.rot-msg.ok { color: var(--ok); } .rot-msg.err { color: var(--err); }
@media (max-width: 700px) { .rotate-box { padding: 4px 12px 0; } }

/* ---------- form controls: WCAG 1.4.11 non-text contrast -- every field's outline is >= 3:1 against both the page
   and its own fill (light #6e7781 4.6:1, dark #6e7681 4.1-4.5:1 around a darker #010409 fill, as GitHub-dark /
   EaglePress dark do), placeholder text >= 4.5:1, and a 2 px focus ring in the link colour. ---------- */
input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=file]), textarea, select,
.search input, .hi-search input, .form input, .form textarea, .upload input:not([type=file]):not([type=checkbox]), .upload textarea {
    background-color: var(--input-bg) !important; border-color: var(--input-border) !important; color: var(--text); }
.search button, .hi-search button { border-color: var(--input-border) !important; }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 1; }
input:focus-visible, textarea:focus-visible, select:focus-visible, .search input:focus, .hi-search input:focus,
.form input:focus, .form textarea:focus, .upload input:focus, .upload textarea:focus {
    border-color: var(--focus) !important; outline: 2px solid var(--focus); outline-offset: 1px; }
.c-form textarea, .reply-form textarea { border: 1px solid var(--input-border) !important; border-radius: 10px; padding: 9px 12px !important; }
.cats, .drop { border-color: var(--input-border); }
input[type=checkbox], input[type=radio], input[type=range] { accent-color: var(--link); }
button:focus-visible, a:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.btn.ghost, .likes, .tabs a, .chips a { box-shadow: inset 0 0 0 1px var(--border); }

/* the GoodTvTube logo picture (images_site/logo-*.png: a flat wall-mounted TV redrawn from Stan's GoodTvTube.png -- no knobs, no gloss) */
.logo-img { height: 28px; width: auto; display: block; }
.hi-logo img { height: 56px; width: auto; }
/* logo: black outline in light mode, white outline in dark mode (2026-12-01) */
.logo-img.dk, .hi-logo img.dk { display: none; }
[data-theme="dark"] .logo-img.lt, [data-theme="dark"] .hi-logo img.lt { display: none; }
[data-theme="dark"] .logo-img.dk, [data-theme="dark"] .hi-logo img.dk { display: block; }

/* upload page: the whole page is one column centred directly under the search box (js/gtt.js lines it up with the
   search box; without the script it is simply centred) -- the form itself is unchanged */
.under-search { width: 100%; max-width: 640px; margin: 0 auto; }
.under-search .page-head { justify-content: center; text-align: center; }
.under-search .upload { max-width: none; }
