:root {
  --bg: #f7f5ef;
  --surface: #ffffff;
  --surface-2: #efebe0;
  --text: #1b1f1c;
  --muted: #5f665f;
  --border: #ddd7c8;
  --green: #0f7a4a;
  --green-dark: #0a5c37;
  --gold: #f5b81c;
  --clay: #e05a2b;
  --danger: #c0392b;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(0,0,0,.08);
  font-family: 'Noto Sans', 'Noto Sans Ethiopic', 'Noto Sans Arabic', system-ui, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1a14;
    --surface: #16241c;
    --surface-2: #1f3127;
    --text: #eef2ec;
    --muted: #a3b0a6;
    --border: #2a3f33;
    --green: #1fa463;
    --green-dark: #17834f;
    --shadow: none;
  }
}
[lang="am"] { font-family: 'Noto Sans Ethiopic', 'Noto Sans', system-ui, sans-serif; }
[lang="ar"] { font-family: 'Noto Sans Arabic', 'Noto Sans', system-ui, sans-serif; }

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font-size: 15px; line-height: 1.5; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
img { display: block; max-width: 100%; }
[hidden] { display: none !important; }

/* ---------- top bar */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 16px;
  padding: 10px 16px; background: var(--surface); border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.topbar .brand img { width: 84px; height: 84px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-text strong { font-size: 66px; font-weight: 800; letter-spacing: 1px; line-height: 1; color: var(--green); }
.brand-text small { font-size: 18px; font-weight: 600; color: var(--muted); }
.search { flex: 1; display: flex; max-width: 560px; margin: 0 auto; }
.search input {
  flex: 1; min-width: 0; padding: 9px 14px; border: 1px solid var(--border);
  background: var(--bg); border-radius: 999px 0 0 999px; border-inline-end: 0;
}
[dir="rtl"] .search input { border-radius: 0 999px 999px 0; }
[dir="rtl"] .search button { border-radius: 999px 0 0 999px; }
.search button {
  padding: 0 18px; border: 1px solid var(--border); background: var(--surface-2);
  border-radius: 0 999px 999px 0; cursor: pointer;
}
.actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.actions select { padding: 7px 8px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 16px; border-radius: 999px; border: 1px solid transparent;
  background: var(--green); color: #fff; font-weight: 600; cursor: pointer; white-space: nowrap;
}
.btn:hover { background: var(--green-dark); }
.btn:disabled { opacity: .6; cursor: default; }
.btn.ghost { background: transparent; border-color: var(--border); color: var(--text); }
.btn.ghost:hover { background: var(--surface-2); }
.btn.gold { background: var(--gold); color: #1b1f1c; }
.btn.active { background: var(--surface-2); color: var(--text); border-color: var(--border); }
.btn.danger { background: transparent; color: var(--danger); border-color: var(--danger); }
.linkish { background: none; border: 0; padding: 0; color: var(--muted); cursor: pointer; font-size: 13px; }

.avatar {
  width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0;
  display: grid; place-items: center; font-weight: 700; color: #fff;
  background: linear-gradient(135deg, var(--green), var(--clay));
}
.avatar.lg { width: 84px; height: 84px; font-size: 34px; }
.menu { position: relative; }
.menu-list {
  position: absolute; inset-inline-end: 0; top: 44px; min-width: 190px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0,0,0,.18); padding: 6px; display: none;
}
.menu.open .menu-list { display: block; }
.menu-list a, .menu-list button {
  display: block; width: 100%; text-align: start; padding: 9px 12px; border-radius: 8px;
  background: none; border: 0; cursor: pointer;
}
.menu-list a:hover, .menu-list button:hover { background: var(--surface-2); }

.icon-btn {
  display: grid; place-items: center; width: 40px; height: 40px; flex-shrink: 0;
  border: 0; border-radius: 50%; background: transparent; cursor: pointer;
}
.icon-btn:hover { background: var(--surface-2); }

/* ---------- sidebar: docked on wide screens, a slide-in drawer otherwise */
.layout { display: flex; align-items: flex-start; }
.sidebar {
  position: fixed; top: 0; bottom: 0; inset-inline-start: 0; z-index: 30; width: 240px;
  overflow-y: auto; padding: 10px; background: var(--surface);
  box-shadow: 0 0 24px rgba(0,0,0,.25); transform: translateX(-105%); transition: transform .2s;
}
[dir="rtl"] .sidebar { transform: translateX(105%); }
body.drawer-open .sidebar { transform: none; }
.scrim { display: none; }
body.drawer-open .scrim { display: block; position: fixed; inset: 0; z-index: 25; background: rgba(0,0,0,.45); }
body.docked .sidebar {
  position: sticky; top: 105px; height: calc(100vh - 105px); flex-shrink: 0; z-index: auto;
  transform: none; box-shadow: none; background: var(--bg); transition: none;
}
.drawer-head { display: flex; align-items: center; gap: 8px; padding: 0 4px 10px; }
body.docked .drawer-head { display: none; }
.nav-item {
  display: flex; align-items: center; gap: 18px; padding: 9px 12px; border-radius: 10px;
  font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.nav-item:hover { background: var(--surface-2); }
.nav-item.on { background: var(--surface-2); font-weight: 600; }
.nav-item svg { flex-shrink: 0; }
.nav-item .avatar { width: 24px; height: 24px; font-size: 11px; }
.nav-title { font-weight: 700; padding: 8px 12px 4px; font-size: 15px; }
.sidebar hr { border: 0; border-top: 1px solid var(--border); margin: 10px 4px; }
.nav-prompt { padding: 4px 12px; font-size: 14px; color: var(--muted); }
.nav-prompt .btn { margin-top: 10px; }
.nav-foot { padding: 12px; font-size: 12px; color: var(--muted); }
.nav-more { width: 100%; border: 0; background: none; cursor: pointer; }

/* ---------- layout */
main { flex: 1; min-width: 0; max-width: 1400px; margin: 0 auto; padding: 20px 16px 60px; }
.page-head { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.page-head h2 { margin: 0; }
.hero {
  border-radius: 18px; padding: 28px; margin-bottom: 20px; color: #fff; text-align: center;
  background:
    radial-gradient(circle at 85% 20%, rgba(245,184,28,.45), transparent 40%),
    radial-gradient(circle at 10% 90%, rgba(224,90,43,.5), transparent 45%),
    linear-gradient(135deg, #0a5c37, #0f7a4a);
}
.hero h1 { margin: 0 0 6px; font-size: clamp(22px, 3.2vw, 34px); line-height: 1.25; }
.hero p { margin: 0 auto; opacity: .92; max-width: 760px; }
.hero .langs-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 16px; }
.hero .langs-row span { background: rgba(255,255,255,.16); padding: 4px 12px; border-radius: 999px; font-size: 13px; }

.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 18px; scrollbar-width: thin; }
.chip {
  flex-shrink: 0; padding: 6px 14px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--surface); cursor: pointer; font-size: 14px;
}
.chip.on { background: var(--text); color: var(--bg); border-color: var(--text); }
.toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.toolbar label { display: flex; gap: 8px; align-items: center; color: var(--muted); font-size: 14px; cursor: pointer; }

.grid { display: grid; gap: 22px 16px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.card { display: block; }
.thumb {
  position: relative; aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden;
  background: linear-gradient(135deg, var(--green-dark), var(--clay));
}
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb .ph { position: absolute; inset: 0; display: grid; place-items: center; font-size: 42px; font-weight: 700; color: rgba(255,255,255,.85); }
.thumb .dur {
  position: absolute; bottom: 6px; inset-inline-end: 6px; background: rgba(0,0,0,.78); color: #fff;
  font-size: 12px; padding: 1px 6px; border-radius: 4px; direction: ltr;
}
.card-meta { display: flex; gap: 10px; padding-top: 10px; }
.card-meta .avatar { width: 34px; height: 34px; font-size: 14px; }
.card h3 { margin: 0; font-size: 15px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sub { color: var(--muted); font-size: 13px; }
.badges { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.badge { font-size: 11px; padding: 1px 6px; border-radius: 4px; background: var(--surface-2); color: var(--muted); letter-spacing: .3px; }
.badge.spoken { background: var(--gold); color: #1b1f1c; font-weight: 600; }
.empty { text-align: center; color: var(--muted); padding: 60px 16px; }
.more-btn { display: flex; justify-content: center; margin-top: 26px; }

/* ---------- watch */
.watch { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 24px; }
.player { width: 100%; aspect-ratio: 16 / 9; background: #000; border-radius: var(--radius); }
.watch h1 { font-size: 20px; margin: 14px 0 8px; }
.row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.channel-row { display: flex; align-items: center; gap: 12px; }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; margin-top: 14px; box-shadow: var(--shadow); }
.panel h2 { font-size: 16px; margin: 0 0 10px; }
.desc { white-space: pre-wrap; word-wrap: break-word; }
.sub-picker { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.quality-row { margin-bottom: 12px; }
.note { font-size: 12px; color: var(--muted); margin-top: 8px; }
.side .card { display: grid; grid-template-columns: 168px 1fr; gap: 10px; margin-bottom: 12px; }
.side .card .card-meta { padding-top: 0; }
.side .card .avatar { display: none; }
.side .card h3 { font-size: 14px; }
.comment { display: flex; gap: 10px; padding: 10px 0; border-top: 1px solid var(--border); }
.comment:first-of-type { border-top: 0; }
.comment p { margin: 2px 0 0; white-space: pre-wrap; word-wrap: break-word; }
textarea, .field input, .field select {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg);
}
textarea { resize: vertical; min-height: 64px; }
.progress { height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; margin-top: 10px; }
.progress div { height: 100%; width: 0; background: var(--green); transition: width .2s; }
.status { font-size: 14px; color: var(--muted); margin-top: 6px; }

/* ---------- subtitle editor */
.editor { margin-top: 14px; border-top: 1px solid var(--border); padding-top: 14px; }
.editor select { padding: 7px 8px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); }
.ed-rows { max-height: 60vh; overflow-y: auto; margin-top: 10px; border: 1px solid var(--border); border-radius: 10px; }
.ed-row { display: grid; grid-template-columns: 64px 1fr; gap: 10px; padding: 10px; border-top: 1px solid var(--border); }
.ed-row:first-child { border-top: 0; }
.ed-row.now { background: var(--surface-2); }
.ed-row textarea { min-height: 0; }
.ed-time {
  align-self: start; padding: 4px 6px; border-radius: 6px; border: 1px solid var(--border);
  background: var(--bg); cursor: pointer; font-size: 13px; direction: ltr;
}
.ed-time:hover { border-color: var(--green); color: var(--green); }
.ed-ref { font-size: 13px; color: var(--muted); margin-bottom: 4px; }

/* ---------- subtitle service */
.tiers { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; max-width: 760px; margin: 0 auto 10px; }
.tier { text-align: center; margin-top: 0; }
.tier.featured { border: 2px solid var(--green); }
.tier .price { font-size: 32px; font-weight: 700; color: var(--green); }
.tier p { margin: 10px 0 0; }
.lang-checks { display: flex; flex-wrap: wrap; gap: 4px 18px; }
.lang-checks .check { display: inline-flex; margin: 0; font-weight: 400; }
.estimate { font-size: 18px; margin: 4px 0 12px; }
.req-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.req-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.req-table th, .req-table td { padding: 10px 12px; border-bottom: 1px solid var(--border); text-align: start; vertical-align: top; }
.req-table th { background: var(--surface-2); min-width: 90px; font-size: 13px; }
.req-table td:nth-child(2) { min-width: 170px; }
.req-table td:nth-child(4) { max-width: 220px; }
.req-table a { color: var(--green); word-break: break-all; }
.req-msg { max-width: 260px; white-space: pre-wrap; }
@media (max-width: 640px) { .tiers { grid-template-columns: 1fr; } }

/* ---------- forms */
.form-card { max-width: 520px; margin: 20px auto; background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 26px; box-shadow: var(--shadow); }
.form-card.wide { max-width: 720px; }
.form-card h1 { margin: 0 0 18px; font-size: 22px; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 5px; }
.field small { color: var(--muted); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.err { color: var(--danger); font-size: 14px; min-height: 20px; }
.check { display: flex; gap: 8px; align-items: center; margin: 6px 0 16px; }
.preview-thumb { margin-top: 10px; max-width: 320px; border-radius: 10px; }

/* ---------- channel */
.channel-head { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; padding: 22px 0; border-bottom: 1px solid var(--border); margin-bottom: 20px; }
.channel-head h1 { margin: 0; font-size: 26px; }

@media (max-width: 1000px) {
  /* minmax(0, …): a long title without spaces must not widen the page past the screen */
  .watch { grid-template-columns: minmax(0, 1fr); }
}
.watch h1, .live-page h1, .card h3 { overflow-wrap: anywhere; }
@media (max-width: 640px) {
  .topbar { flex-wrap: wrap; gap: 10px; }
  .brand-text small { display: none; }
  .topbar .brand img { width: 56px; height: 56px; }
  .brand-text strong { font-size: 42px; }
  .search { order: 3; flex-basis: 100%; }
  .actions { margin-inline-start: auto; }
  .hero { padding: 20px; }
  .two { grid-template-columns: 1fr; }
  .side .card { grid-template-columns: 140px 1fr; }
  .form-card { padding: 18px; }
  .upload-label { display: none; }
}

/* Reports and moderation */
.badge.removed { background: var(--danger); color: #fff; font-weight: 600; }
.nav-foot a { text-decoration: underline; }
.banner { margin-top: 12px; padding: 12px 16px; border-radius: var(--radius); border: 1px solid var(--danger);
  background: color-mix(in srgb, var(--danger) 10%, var(--surface)); }
.banner p { margin: 8px 0; }
.banner textarea { width: 100%; margin-bottom: 6px; }
.report-form .reasons { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0 12px; }
.report-form .check { margin: 4px 0; }
.report-form textarea { width: 100%; margin: 8px 0 4px; }
.admin-tools { border-color: var(--gold); }
.admin-tools svg { vertical-align: middle; }
.page-head h2 svg { vertical-align: -3px; }
.mod-item { display: grid; gap: 8px; }
.mod-item.row { display: flex; }
.mod-item.urgent { border: 2px solid var(--danger); }
.mod-item blockquote { margin: 0; padding: 6px 12px; border-inline-start: 3px solid var(--border); white-space: pre-wrap; }
.claim { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; margin: 0; }
.claim dt { color: var(--muted); }
.claim dd { margin: 0; overflow-wrap: anywhere; }
.doc ol { padding-inline-start: 22px; }
.doc li { margin-bottom: 8px; }
.doc h2 { font-size: 18px; margin-top: 22px; }
a.chip { display: inline-block; }
.mod-notes { margin: 0; padding-inline-start: 18px; font-size: 14px; }
.note a, .report-form a { text-decoration: underline; }

/* AI voice-over */
.listen-row { margin-bottom: 10px; }
.badge.voice { background: var(--green); color: #fff; }
.dub-form .lang-checks { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-bottom: 10px; }

/* Install page */
.install-cta { margin-top: 14px; display: inline-flex; align-items: center; gap: 6px; }
.install-cta svg, .install-page .btn svg { vertical-align: middle; }
.install-page h1 { display: flex; align-items: center; gap: 12px; }
.install-page h1 img { border-radius: 12px; }
.install-page ol li { margin-bottom: 10px; }
.copy-link { display: flex; gap: 8px; margin-top: 12px; }
.copy-link input { flex: 1; min-width: 0; }

/* "A new version is ready" bar after a release */
.update-bar {
  position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 50;
  max-width: calc(100% - 32px); padding: 12px 18px; border: 0; border-radius: 999px;
  background: var(--gold, #fcd116); color: #111; font: inherit; font-weight: 600;
  box-shadow: 0 4px 16px rgba(0, 0, 0, .35); cursor: pointer;
}

/* ---------- live broadcasts */
.live-title { font-size: 18px; margin: 4px 0 12px; }
#liveStrip .grid { margin-bottom: 26px; }
.thumb .live-ph { background: linear-gradient(135deg, #7a0f0f, var(--clay)); }
.live-badge {
  position: absolute; top: 6px; inset-inline-start: 6px; background: #d92020; color: #fff;
  font-size: 12px; font-weight: 700; padding: 1px 7px; border-radius: 4px; letter-spacing: .03em;
}
.live-badge.static { position: static; display: inline-block; }
.live-page { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 24px; }
.live-page h1 { font-size: 20px; margin: 14px 0 8px; }
.live-screen {
  width: 100%; aspect-ratio: 16 / 9; background: #000; color: #fff; border-radius: var(--radius);
  display: grid; place-content: center; justify-items: center; gap: 10px; text-align: center; padding: 16px; font-size: 34px;
}
.live-screen p { font-size: 16px; margin: 0; max-width: 520px; }
.live-screen small { font-size: 13px; color: #ccc; max-width: 520px; }
.live-info { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.live-info .channel-link { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.live-info .channel-link .avatar { width: 32px; height: 32px; font-size: 14px; }
.live-info .spacer { flex: 1; }
.live-chat { display: flex; flex-direction: column; height: min(70vh, 640px); margin-top: 0; }
.live-chat h2 { font-size: 16px; margin: 0 0 8px; }
.chat-list { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; padding-inline-end: 4px; overflow-wrap: anywhere; }
.chat-line { font-size: 14px; }
.chat-line strong { color: var(--green); margin-inline-end: 4px; }
.chat-line .link { background: none; border: 0; color: var(--muted); cursor: pointer; padding: 0 4px; }
.chat-form { display: flex; gap: 8px; margin-top: 10px; }
.chat-form input { flex: 1; min-width: 0; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); }
.studio h3 { font-size: 15px; margin: 16px 0 4px; }
.copy-row { display: flex; gap: 6px; }
.copy-row input { flex: 1; min-width: 0; font-family: ui-monospace, monospace; font-size: 13px; }
.cam-preview { display: block; width: 100%; max-width: 560px; min-height: 180px; max-height: 60vh; object-fit: contain; background: #000; border-radius: var(--radius); margin-top: 12px; }
.cam-preview.mirror { transform: scaleX(-1); }
@media (max-width: 1000px) {
  .live-page { grid-template-columns: minmax(0, 1fr); }
  .live-chat { height: 420px; }
}

/* ---------- ads */
.ad-badge {
  position: absolute; top: 6px; inset-inline-start: 6px; background: var(--gold); color: #1b1f1c;
  font-size: 12px; font-weight: 700; padding: 1px 7px; border-radius: 4px;
}
.ad-badge.static { position: static; display: inline-block; }
.ad-card .ad-cta { margin-top: 6px; padding: 3px 10px; font-size: 13px; }
.player-box { position: relative; }
.ad-overlay { position: absolute; inset: 0; background: #000; border-radius: var(--radius); overflow: hidden; z-index: 2; }
.ad-overlay video, .ad-overlay img { width: 100%; height: 100%; object-fit: contain; }
.ad-top { position: absolute; top: 10px; inset-inline-start: 10px; color: #fff; font-size: 14px; text-shadow: 0 1px 2px #000; }
.ad-bottom { position: absolute; bottom: 12px; inset-inline: 12px; display: flex; justify-content: space-between; gap: 10px; }
.ad-skip { background: rgba(0,0,0,.75); color: #fff; border-color: rgba(255,255,255,.6); }
.ad-skip:disabled { opacity: .85; }
.table-wrap { overflow-x: auto; }
.ads-table { width: 100%; border-collapse: collapse; font-size: 14px; margin: 8px 0 18px; }
.ads-table th, .ads-table td { text-align: start; padding: 8px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
.ads-table th { color: var(--muted); font-weight: 600; }
.nowrap { white-space: nowrap; }
.check-row { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.ad-preview { max-width: 320px; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 8px; margin: 6px 0; }
.ad-totals { display: flex; flex-wrap: wrap; gap: 14px; margin: 16px 0; }
.ad-totals div { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 18px; min-width: 150px; }
.ad-totals strong { display: block; font-size: 26px; }
.ad-totals span { color: var(--muted); font-size: 13px; }
@media print {
  header, #sidebar, .no-print, .update-bar { display: none !important; }
  body { background: #fff; color: #000; }
  main, #app { margin: 0 !important; padding: 0 !important; }
}
.quality-row .btn { white-space: normal; max-width: 100%; text-align: start; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; opacity: 0; }
.adv-list { padding-inline-start: 20px; } .adv-list li { margin: 6px 0; }
.field .check input[type=checkbox], .field .check input[type=radio] { width: auto; padding: 0; }
.check-row .check { margin: 4px 0; }
.rec-panel strong { margin-inline-end: 8px; }
.job-panel {
  position: fixed; bottom: 12px; inset-inline-end: 12px; width: min(420px, calc(100vw - 24px)); z-index: 60;
  margin: 0; box-shadow: 0 6px 24px rgba(0,0,0,.25);
}
.job-panel .job-close { position: absolute; top: 6px; inset-inline-end: 8px; background: none; border: 0; font-size: 18px; color: var(--muted); cursor: pointer; }
.job-panel strong { display: block; padding-inline-end: 24px; }
.note.warn { color: var(--clay); font-weight: 600; }
/* The camera feeds the canvas; it must keep playing, so it is hidden this way, not with display: none. */
.cam-source { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
canvas.cam-preview { height: auto; }
.bg-picker { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 10px; }

/* ---------- account, notifications, legal */
.captcha { margin: 8px 0; min-height: 0; }
.danger-zone { border-color: var(--danger); }
.notice.unread { border-inline-start: 4px solid var(--gold); }
.legal h1 { margin-bottom: 4px; }
.legal h2 { font-size: 17px; margin: 20px 0 6px; }
.legal p, .legal li { line-height: 1.6; }
.err-text { white-space: pre-wrap; font-size: 12px; margin: 6px 0 0; max-height: 160px; overflow: auto; }
.restyle .chip input { display: none; }
.restyle .chip:has(input:checked) { background: var(--green); color: #fff; border-color: var(--green); }
/* Smaller subtitles, so two lines don't cover the speaker's face. */
video.player::cue { font-size: 78%; line-height: 1.25; background: rgba(0, 0, 0, .62); }

/* Sharing */
.share-box .sub-picker { margin-bottom: 10px; }
.btn.whatsapp { background: #25d366; color: #0b2b17; }
.share-link { display: flex; gap: 8px; }
.share-link input { flex: 1; min-width: 0; }
.desc a.tag { color: var(--green); font-weight: 600; }

/* Shorts: full screen, one video per swipe */
.shorts { height: calc(100dvh - 90px); overflow-y: auto; scroll-snap-type: y mandatory; max-width: 480px; margin: 0 auto;
  border-radius: var(--radius); background: #000; scrollbar-width: none; }
.shorts::-webkit-scrollbar { display: none; }
.short { position: relative; height: 100%; scroll-snap-align: start; scroll-snap-stop: always; background: #000; }
.short video { width: 100%; height: 100%; object-fit: contain; display: block; }
.short video::cue { font-size: 90%; }
.short-info { position: absolute; left: 12px; right: 64px; bottom: 16px; color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,.8); }
.short-info a { color: #fff; }
.short-info .sub { color: #ddd; }
.short-actions { position: absolute; right: 8px; bottom: 16px; display: flex; flex-direction: column; gap: 10px; }
.short-actions .icon-btn { width: 46px; height: 46px; border-radius: 50%; background: rgba(0,0,0,.45); color: #fff; font-size: 20px;
  display: flex; align-items: center; justify-content: center; text-decoration: none; border: 0; }

/* Creator stats */
.stat-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.stat-card { margin-top: 0; }
.stat-num { font-size: 26px; font-weight: 700; color: var(--green); }
.stat-chart { display: flex; align-items: flex-end; gap: 2px; height: 140px; }
.stat-chart i { flex: 1; background: var(--green); border-radius: 2px 2px 0 0; min-height: 1px; }
.stat-axis { display: flex; justify-content: space-between; color: var(--muted); font-size: 12px; margin-top: 4px; }
.stat-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 0 14px; }
.stat-row { display: grid; grid-template-columns: minmax(80px, 1fr) 2fr auto; gap: 8px; align-items: center; margin: 6px 0; font-size: 14px; }
.stat-bar { background: var(--surface-2); border-radius: 4px; height: 8px; overflow: hidden; }
.stat-bar i { display: block; height: 100%; background: var(--gold); }
.stat-table-wrap { overflow-x: auto; }
.stat-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.stat-table th, .stat-table td { padding: 6px 8px; border-bottom: 1px solid var(--border); text-align: end; white-space: nowrap; }
.stat-table th:first-child, .stat-table td:first-child { text-align: start; white-space: normal; }

/* Playlists */
.check-row { display: flex; gap: 8px; align-items: center; padding: 6px 0; }
.new-playlist { display: flex; gap: 8px; margin-top: 8px; }
.new-playlist input { flex: 1; min-width: 0; }
.playlist-panel { margin-top: 0; margin-bottom: 14px; }
.playlist-panel h3 { margin: 0 0 2px; font-size: 16px; }
.playlist-panel h3 a { color: inherit; }
.playlist-items { max-height: 380px; overflow-y: auto; margin-top: 8px; }
.pl-item { display: flex; gap: 10px; align-items: center; padding: 6px; border-radius: 8px; color: inherit; text-decoration: none; flex: 1; min-width: 0; }
.pl-item:hover, .pl-item.on { background: var(--surface-2); }
.pl-item img { width: 100px; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 6px; flex: none; }
.pl-n { width: 22px; flex: none; text-align: center; color: var(--muted); }
.pl-row { display: flex; align-items: center; gap: 8px; border-bottom: 1px solid var(--border); padding: 4px 0; }
#channelPlaylists h2 { margin-top: 28px; }

/* Duets and sounds */
.remix-stage { position: relative; background: #000; border-radius: var(--radius); overflow: hidden; }
.remix-stage canvas { display: block; width: 100%; max-height: 70vh; object-fit: contain; }
.remix-count { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 96px; font-weight: 700; color: #fff; text-shadow: 0 2px 8px rgba(0,0,0,.6); }
.remix #remixControls { margin-top: 10px; align-items: center; }
.remix-of { margin: 8px 0; }
.sound-row { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.sound-row img { width: 72px; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 6px; flex: none; }
.sound-meta { flex: 1; min-width: 0; }
.sound-meta a { color: inherit; }
.sound-play { width: 40px; height: 40px; border-radius: 50%; background: var(--green); color: #fff; border: 0; flex: none; }
@media (max-width: 600px) { .sound-row img { display: none; } .sound-row .btn { padding: 6px 10px; font-size: 13px; } }

/* Coins and gifts */
.gift-open { margin-top: 8px; width: 100%; }
.gift-tray { margin-top: 8px; }
.gift-list { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.gift { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 10px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text); cursor: pointer; min-width: 56px; }
.gift:disabled { opacity: .45; cursor: default; }
.gift-emoji { font-size: 26px; line-height: 1; }
.gift-list.big .gift { cursor: default; }
.chat-line.gift-line { background: rgba(245, 184, 28, .18); border-radius: 8px; padding: 4px 6px; }
.chat-line.gift-line strong + * , .chat-line.gift-line { font-size: 15px; }
.coin-packs { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin-bottom: 10px; }
.coin-pack { display: flex; flex-direction: column; gap: 4px; padding: 12px; border: 1px solid var(--border); border-radius: 10px; cursor: pointer; }
.coin-pack:has(input:checked) { border-color: var(--green); box-shadow: 0 0 0 2px var(--green) inset; }
.coin-pack input { align-self: flex-start; }
