/* «شكل الشاشة» and إعلانات الشاشة — the live editor (tv-editor.js) as used on the dashboard (index.html › شاشة العرض)
   and in the ⚙ panel on the screen itself (tv.html). Self-contained: its own variables, no Bootstrap, Font Awesome icons. */

:root {
    --tv-brand: #047857;
    --tv-brand-dark: #064E3B;
    --tv-brand-100: #D1FAE5;
    --tv-brand-50: #ECFDF5;
    --tv-on-brand: #ffffff;
    --tv-surface: #ffffff;
    --tv-surface-muted: #F1F5F9;
    --tv-page-bg: #F8FAFC;
    --tv-border: #E2E8F0;
    --tv-text: #0F172A;
    --tv-muted: #64748B;
    --tv-success: #047857;
    --tv-success-bg: #D1FAE5;
    --tv-warning: #F59E0B;
    --tv-danger: #B91C1C;
    --tv-radius: 16px;
    --tv-radius-sm: 10px;
    --tv-pill: 999px;
    --tv-shadow-sm: 0 1px 2px rgba(15, 23, 42, .06), 0 1px 3px rgba(15, 23, 42, .08);
    --tv-shadow-lg: 0 12px 32px rgba(15, 23, 42, .14), 0 4px 8px rgba(15, 23, 42, .05);
    --tv-focus: 0 0 0 3px rgba(4, 120, 87, .3);
    --tv-content-pad: 2rem;
}

/* ---------------------------------------------------------------- the controls (both places) */

.tvd-tabs { display: flex; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--tv-border); }
.tvd-tabs::-webkit-scrollbar { display: none; }
.tvd-tabs button { flex: 1 0 auto; border: 0; background: none; padding: .8rem .85rem; font: inherit; font-size: .88rem; font-weight: 600; color: var(--tv-muted); border-bottom: 3px solid transparent; white-space: nowrap; cursor: pointer; }
.tvd-tabs button i { margin-inline-end: .25rem; }
.tvd-tabs button[aria-selected="true"] { color: var(--tv-brand); border-bottom-color: var(--tv-brand); }
@media (max-width: 459.98px) {
    /* All five tabs on one phone-wide row */
    .tvd-tabs button { padding-inline: .3rem; font-size: .85rem; }
    .tvd-tabs button i { display: none; }
}
.tvd-panel { padding: 1rem 1rem .5rem; }
.tvd-field { margin-bottom: 1.15rem; }
.tvd-label { display: flex; align-items: center; gap: .4rem; margin-bottom: .45rem; font-weight: 600; font-size: .92rem; }
.tvd-label > span { flex: 1; }
.tvd-label output { min-width: 3.6em; text-align: center; background: var(--tv-brand-50); color: var(--tv-brand); border-radius: var(--tv-pill); padding: .1rem .5rem; font-weight: 700; direction: ltr; }
.tvd-undo { visibility: hidden; border: 0; background: none; color: var(--tv-muted); width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; cursor: pointer; }
.tvd-undo.show { visibility: visible; }
.tvd-undo:hover { background: var(--tv-surface-muted); color: var(--tv-brand); }
.tvd-stepper { display: flex; align-items: center; gap: .6rem; }
.tvd-stepper button { width: 44px; height: 44px; flex-shrink: 0; border: 1px solid var(--tv-border); background: var(--tv-surface); color: var(--tv-text); border-radius: 50%; font-size: 1.1rem; display: grid; place-items: center; touch-action: manipulation; user-select: none; cursor: pointer; }
.tvd-stepper button:hover { border-color: var(--tv-brand-100); }
.tvd-stepper button:active { background: var(--tv-brand-50); border-color: var(--tv-brand-100); }
.tvd-stepper input[type=range] { flex: 1; min-width: 0; accent-color: var(--tv-brand); height: 44px; margin: 0; }
.tvd-seg { display: flex; gap: .3rem; background: var(--tv-surface-muted); border-radius: var(--tv-radius-sm); padding: .25rem; }
.tvd-seg button { flex: 1; min-height: 40px; border: 0; border-radius: calc(var(--tv-radius-sm) - 2px); background: none; color: var(--tv-muted); font: inherit; font-weight: 600; font-size: .88rem; padding: 0 .4rem; cursor: pointer; }
.tvd-seg button[aria-checked="true"] { background: var(--tv-surface); color: var(--tv-brand); box-shadow: var(--tv-shadow-sm); }
.tvd-color { display: flex; align-items: center; gap: .5rem; padding: .55rem 0; border-top: 1px solid var(--tv-border); font-weight: 600; font-size: .92rem; margin: 0; cursor: pointer; }
.tvd-color > span { flex: 1; }
.tvd-color input[type=color] { width: 52px; height: 36px; padding: 2px; border: 1px solid var(--tv-border); border-radius: var(--tv-radius-sm); background: var(--tv-surface); cursor: pointer; }
.tvd-presets { display: grid; grid-template-columns: repeat(2, 1fr); gap: .5rem; }
.tvd-presets button { display: flex; align-items: center; gap: .5rem; border: 1px solid var(--tv-border); background: var(--tv-surface); border-radius: var(--tv-radius-sm); padding: .5rem .6rem; font: inherit; font-size: .86rem; font-weight: 600; color: var(--tv-text); cursor: pointer; }
.tvd-presets i { width: 26px; height: 26px; border-radius: 50%; flex-shrink: 0; background: linear-gradient(135deg, var(--a) 50%, var(--b) 50%); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .25); }
.tvd-tip { font-size: .82rem; color: var(--tv-muted); margin: .5rem 0 .75rem; }
.tvd-input { display: block; width: 100%; box-sizing: border-box; min-height: 44px; padding: .5rem .75rem; font: inherit; font-size: .95rem; color: var(--tv-text); background: var(--tv-surface); border: 1px solid var(--tv-border); border-radius: var(--tv-radius-sm); }
.tvd-input:focus { outline: 0; border-color: var(--tv-brand); box-shadow: var(--tv-focus); }
.tvd-clip-row { margin: -.55rem 0 1.1rem; }
.tvd-clip-row:has(.tvd-clip[hidden]) { display: none; }
.tvd-tip.tvx-only { display: none; }
.tvx .tvd-tip.tvx-only { display: block; }
.tvd-clip { display: inline-block; background: var(--tv-warning); color: var(--tv-text); border-radius: var(--tv-pill); padding: .1rem .55rem; font-size: .8rem; font-weight: 600; white-space: nowrap; }

/* Buttons (own, so the screen page needs no Bootstrap) */
.tvd-btn { display: inline-flex; align-items: center; justify-content: center; gap: .3rem; min-height: 42px; padding: 0 .9rem; border: 1px solid var(--tv-border); border-radius: var(--tv-radius-sm); background: var(--tv-surface); color: var(--tv-text); font: inherit; font-size: .9rem; font-weight: 600; white-space: nowrap; cursor: pointer; }
.tvd-btn:hover:not(:disabled) { background: var(--tv-brand-50); }
.tvd-btn.primary { background: var(--tv-brand); border-color: var(--tv-brand); color: var(--tv-on-brand); }
.tvd-btn.primary:hover:not(:disabled) { background: var(--tv-brand-dark); }
.tvd-btn:disabled { opacity: .45; cursor: default; }

/* Save bar: calm when everything is saved, highlighted when there is something to save */
.tvd-bar { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; background: var(--tv-surface); border: 1px solid var(--tv-border); border-radius: var(--tv-radius); padding: .75rem 1rem; }
.tvd-state { flex: 1; min-width: 0; font-size: .87rem; font-weight: 600; color: var(--tv-success); }
.tvd-state i { margin-inline-end: .2rem; }
.tvd-bar[data-state="dirty"] { border-color: var(--tv-warning); }
.tvd-bar[data-state="dirty"] .tvd-state { color: var(--tv-text); }
.tvd-bar[data-state="dirty"] .tvd-state i { color: var(--tv-warning); font-size: .6rem; vertical-align: .15em; }
.tvd-actions { display: flex; gap: .4rem; }
.tvd-bar.asking .tvd-state, .tvd-bar.asking .tvd-actions { display: none; }
.tvd-confirm { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; width: 100%; }
.tvd-confirm[hidden] { display: none; }
.tvd-confirm > span { flex: 1 0 100%; font-weight: 600; font-size: .9rem; }
@media (max-width: 575.98px) {
    .tvd-bar { flex-direction: column; align-items: stretch; gap: .5rem; }
    .tvd-actions .primary { flex: 1; }
    .tvd-actions .tvd-btn:not(.primary) span { display: none; }
    .tvd-actions .tvd-btn:not(.primary) { width: 46px; padding-inline: 0; }
}

.tvd-toast { position: fixed; bottom: 6.5rem; left: 50%; transform: translateX(-50%); z-index: 2000; background: var(--tv-text); color: var(--tv-surface); padding: .65rem 1rem; border-radius: var(--tv-radius-sm); font-size: .88rem; font-weight: 600; box-shadow: var(--tv-shadow-lg); max-width: calc(100vw - 2rem); text-align: center; transition: opacity .3s; }
.tvd-toast.error { background: var(--tv-danger); color: #fff; }
.tvd-toast.out { opacity: 0; }

/* ---- On the screen itself (tv/screen, signed-in association admin only) ---- */
/* ⚙: small and faint in the bottom-right corner, always there (hidden only while its panel is open) */
.tvx-gear { position: fixed; right: 18px; bottom: 18px; z-index: 900; width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center;
    background: rgba(255, 255, 255, .1); color: rgba(255, 255, 255, .75); font-size: 1.25rem; text-decoration: none;
    backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); transition: opacity .3s, background .2s, transform .2s; }
.tvx-gear:hover, .tvx-gear:focus-visible { background: rgba(255, 255, 255, .22); color: #fff; transform: rotate(30deg); outline: 0; }
html.tvx-open .tvx-gear { opacity: 0; pointer-events: none; }

/* The panel slides in from the right (or the left, «⇄»), over the screen; the screen behind changes live.
   Anchored at the bottom and only as tall as its content, so most of the screen stays in view. */
.tvx { position: fixed; bottom: 0; right: 0; z-index: 1000; width: min(400px, 92vw); max-height: 100vh; box-sizing: border-box;
    border-radius: var(--tv-radius) 0 0 0;
    display: flex; flex-direction: column; background: var(--tv-surface); color: var(--tv-text); font-family: inherit;
    box-shadow: -12px 0 40px rgba(0, 0, 0, .35); transform: translateX(105%); transition: transform .3s ease; }
.tvx.left { right: auto; left: 0; border-radius: 0 var(--tv-radius) 0 0; transform: translateX(-105%); box-shadow: 12px 0 40px rgba(0, 0, 0, .35); }
html.tvx-open .tvx { transform: none; }
@media (prefers-reduced-motion: reduce) { .tvx, .tvx-gear { transition: none; } }
.tvx-head { display: flex; align-items: center; gap: .4rem; padding: .9rem 1rem .5rem; }
.tvx-heading { flex: 1; min-width: 0; }
.tvx-heading h2 { margin: 0; font-size: 1.1rem; color: var(--tv-text); }
.tvx-heading h2 i { color: var(--tv-brand); margin-inline-end: .2rem; }
.tvx-heading p { margin: .15rem 0 0; font-size: .8rem; color: var(--tv-muted); }
.tvx-icon { width: 40px; height: 40px; flex-shrink: 0; border: 1px solid var(--tv-border); border-radius: 50%; background: var(--tv-surface); color: var(--tv-text); display: grid; place-items: center; cursor: pointer; font-size: 1rem; }
.tvx-icon:hover { background: var(--tv-brand-50); }
.tvx-body { flex: 0 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; border-top: 1px solid var(--tv-border); }
.tvx-body .tvd-tabs { position: sticky; top: 0; z-index: 1; background: var(--tv-surface); }
.tvx-bar { border-radius: 0; border-inline: 0; border-bottom: 0; box-shadow: 0 -6px 18px rgba(0, 0, 0, .06); }

/* 400px wide: all five tabs on one row, the save state on its own line above the buttons */
.tvx .tvd-tabs button { padding-inline: .35rem; font-size: .86rem; }
.tvx .tvd-tabs button i { display: none; }
.tvx-bar { gap: .5rem; padding-bottom: max(.75rem, env(safe-area-inset-bottom)); }
.tvx-bar .tvd-state { flex: 1 0 100%; }
.tvx-bar .tvd-actions { flex: 1 0 100%; }
.tvx-bar .tvd-actions .primary { flex: 1; }

/* ---------------------------------------------------------------- dashboard › شاشة العرض */
.tv-setup { max-width: 560px; }
.tv-step { display: flex; align-items: center; gap: .55rem; font-weight: 600; margin-bottom: .75rem; }
.tv-step-num { width: 26px; height: 26px; flex-shrink: 0; border-radius: 50%; background: var(--tv-brand); color: #fff; display: grid; place-items: center; font-size: .85rem; }
.tv-url-box { display: flex; align-items: center; gap: .5rem; background: var(--tv-surface-muted); border: 1px solid var(--tv-border); border-radius: 14px; padding: .85rem 1rem; margin-bottom: 1rem; }
.tv-url { flex: 1; font-family: 'Courier New', monospace; font-size: 1.15rem; font-weight: 700; direction: ltr; text-align: left; word-break: break-all; }
.tv-copy { width: 44px; height: 44px; flex-shrink: 0; border: 0; border-radius: 10px; background: var(--tv-brand); color: #fff; font-size: 1.05rem; }
.tv-copy.copied { background: var(--tv-success); }
.tv-divider { height: 1px; background: var(--tv-border); margin: 1.5rem 0 1.25rem; }
.tv-edit-row { display: flex; align-items: stretch; direction: ltr; border: 1px solid var(--tv-border); border-radius: 12px; overflow: hidden; }
.tv-edit-row.is-invalid { border-color: var(--tv-danger); }
.tv-prefix { display: flex; align-items: center; padding: 0 .75rem; background: var(--tv-surface-muted); color: var(--tv-muted); font-size: .9rem; font-family: 'Courier New', monospace; border-right: 1px solid var(--tv-border); white-space: nowrap; }
.tv-slug { border: 0 !important; border-radius: 0 !important; font-family: 'Courier New', monospace; min-height: 46px; box-shadow: none !important; }
.tv-hint { font-size: .82rem; color: var(--tv-muted); margin: .5rem 0 0; min-height: 1.2em; }
.tv-hint.error { color: var(--tv-danger); }
.tv-hint.ok { color: var(--tv-success); }
.tv-legend { list-style: none; padding: 0; margin: 1.25rem 0 0; display: grid; gap: .35rem; font-size: .85rem; color: var(--tv-muted); }
.tv-legend .dot { display: inline-block; width: 14px; height: 14px; border-radius: 50%; vertical-align: -2px; margin-inline-end: .35rem; }
.tv-legend .dot.green { background: #4fda4f; }
.tv-legend .dot.red { background: #c10000; }
.tv-legend .dot.pulse { background: #252168; box-shadow: 0 0 0 3px rgba(221, 1, 1, .45); }
.tv-legend .dot.white { background: #fff; border: 1px solid var(--tv-border); }

/* «شكل الشاشة» — live editor: the preview stays in view (pinned on phones, beside the controls on wide screens) */
.tvd { margin-top: 1.5rem; max-width: 1180px; }
.tvd-head h2 { font-size: 1.2rem; margin: 0 0 .25rem; }
.tvd-head p { color: var(--tv-muted); font-size: .88rem; margin: 0 0 1rem; }
.tvd-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1rem; }
@media (min-width: 992px) {
    .tvd-grid { grid-template-columns: minmax(0, 1.55fr) minmax(320px, 1fr); align-items: start; }
    .tvd-preview { position: sticky; top: calc(var(--tvd-top, 64px) + 1rem); }
}
@media (max-width: 991.98px) {
    /* Pinned under the top bar while the controls scroll beneath it */
    .tvd-preview-col { position: sticky; top: var(--tvd-top, 60px); z-index: 15; margin-inline: calc(-1 * var(--tv-content-pad)); padding: .5rem var(--tv-content-pad); background: var(--tv-page-bg); }
}
.tvd-preview { background: var(--tv-surface); border: 1px solid var(--tv-border); border-radius: var(--tv-radius); padding: .5rem; box-shadow: var(--tv-shadow-sm); }
.tvd-frame { position: relative; overflow: hidden; border-radius: var(--tv-radius-sm); background: #000; direction: ltr; }
.tvd-frame iframe { position: absolute; top: 0; left: 0; border: 0; transform-origin: 0 0; pointer-events: none; }
.tvd-preview-bar { display: flex; align-items: center; gap: .5rem; padding: .45rem .15rem 0; font-size: .8rem; color: var(--tv-muted); }
.tvd-size { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tvd-clip { background: var(--tv-warning); color: var(--tv-text); border-radius: var(--tv-pill); padding: .1rem .55rem; font-weight: 600; white-space: nowrap; }
.tvd-full-btn { border: 1px solid var(--tv-border); background: var(--tv-surface); color: var(--tv-text); border-radius: var(--tv-radius-sm); height: 34px; padding: 0 .65rem; font-size: .82rem; font-weight: 600; white-space: nowrap; }
.tvd-quick, .tvd-rotate { display: none; }

/* Full-screen preview (phone turned sideways ≈ the TV) with the quick − / + strip */
.tvd-preview.full { position: fixed; inset: 0; z-index: 1060; margin: 0; border: 0; border-radius: 0; padding: 0; background: #000; display: flex; flex-direction: column; }
.tvd-preview.full .tvd-frame { flex: 1; aspect-ratio: auto !important; border-radius: 0; }
.tvd-preview.full .tvd-preview-bar { display: none; }
.tvd-preview.full .tvd-quick { order: -1; display: flex; align-items: center; justify-content: center; gap: .5rem; flex-wrap: wrap; padding: .5rem; padding-top: max(.5rem, env(safe-area-inset-top)); background: rgba(0, 0, 0, .85); color: #fff; }
/* The pinned column is its own stacking layer: lift it above the top bar while its preview fills the screen */
body.tvd-noscroll .tvd-preview-col { z-index: 1065; }
.tvd-quick-item { display: flex; align-items: center; gap: .3rem; background: rgba(255, 255, 255, .1); border-radius: var(--tv-pill); padding: .2rem .3rem .2rem .7rem; font-size: .8rem; }
.tvd-quick-item button, .tvd-quick-close { width: 38px; height: 38px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .16); color: #fff; display: grid; place-items: center; }
.tvd-quick-item output { min-width: 3.2em; text-align: center; font-weight: 700; direction: ltr; }
.tvd-quick-close { background: rgba(255, 255, 255, .28); }
@media (orientation: portrait) and (max-width: 767.98px) {
    .tvd-preview.full .tvd-rotate { display: block; position: absolute; top: max(1rem, env(safe-area-inset-top)); inset-inline: 0; text-align: center; color: #fff; opacity: .75; font-size: .85rem; }
}
body.tvd-noscroll { overflow: hidden; }
body.tvd-noscroll .tvd-page-bar { z-index: 1070; position: fixed; inset-inline: 0; bottom: 0; border-radius: 0; }

/* Controls (the controls themselves: tv-editor.css, shared with the screen's own panel) */
.tvd-controls { background: var(--tv-surface); border: 1px solid var(--tv-border); border-radius: var(--tv-radius); overflow: hidden; }
.tvd-page-bar { margin-top: 1rem; position: sticky; bottom: 0; z-index: 20; box-shadow: var(--tv-shadow-lg); padding-bottom: max(.75rem, env(safe-area-inset-bottom)); }
@media (max-width: 575.98px) {
    .tvd-page-bar { margin-inline: calc(-1 * var(--tv-content-pad)); border-radius: 0; border-inline: 0; }
}
.tva { margin-top: 1.5rem; max-width: 760px; }
.tva-card { background: var(--tv-surface); border: 1px solid var(--tv-border); border-radius: var(--tv-radius); padding: 1rem; }
.tva-add { display: flex; align-items: center; gap: .85rem; margin: 0; padding: 1rem; border: 2px dashed var(--tv-brand-100); border-radius: var(--tv-radius); background: var(--tv-brand-50); color: var(--tv-brand); cursor: pointer; }
.tva-add:hover { border-color: var(--tv-brand); }
.tva-add-icon { font-size: 1.8rem; }
.tva-add span { flex: 1; display: flex; flex-direction: column; }
.tva-add strong { font-size: 1rem; }
.tva-add small { color: var(--tv-muted); font-size: .82rem; }
.tva-add-plus { width: 40px; height: 40px; border-radius: 50%; background: var(--tv-brand); color: var(--tv-on-brand); display: grid; place-items: center; font-size: 1.1rem; }
.tva-add[hidden], .tva-new[hidden] { display: none; }

.tva-new { display: grid; gap: 1rem; padding: 1rem; border: 1px solid var(--tv-brand-100); border-radius: var(--tv-radius); background: var(--tv-surface-muted); }
@media (min-width: 640px) { .tva-new { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; } }
/* The announcement and its optional translation, side by side */
.tva-new-pics { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; align-content: start; }
.tva-new-preview { position: relative; margin: 0; background: #111; border-radius: var(--tv-radius-sm); aspect-ratio: 16 / 9; display: grid; place-items: center; overflow: hidden; }
.tva-new-preview img { max-width: 100%; max-height: 100%; object-fit: contain; }
.tva-new-preview figcaption { position: absolute; bottom: 6px; inset-inline-start: 6px; padding: .05rem .5rem; border-radius: var(--tv-pill); background: rgba(0, 0, 0, .65); color: #fff; font-size: .75rem; font-weight: 600; }
.tva-new-preview figcaption[hidden], .tva-new-preview img[hidden], .tva-new-preview button[hidden] { display: none; }
.tva-tr-slot { background: var(--tv-surface); border: 2px dashed var(--tv-border); }
.tva-tr-slot:has(img:not([hidden])) { background: #111; border: 0; }
.tva-tr-pick { width: 100%; height: 100%; border: 0; background: none; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .15rem; padding: .4rem; color: var(--tv-brand); text-align: center; cursor: pointer; }
.tva-tr-pick i { font-size: 1.3rem; }
.tva-tr-pick strong { font-size: .88rem; }
.tva-tr-pick small { color: var(--tv-muted); font-size: .72rem; line-height: 1.3; }
.tva-tr-remove { position: absolute; top: 6px; inset-inline-end: 6px; width: 30px; height: 30px; border: 0; border-radius: 50%; background: rgba(0, 0, 0, .65); color: #fff; display: grid; place-items: center; font-size: .8rem; }
.tva-new-fields { display: grid; gap: .75rem; }
.tva-field { display: grid; gap: .3rem; margin: 0; font-weight: 600; font-size: .9rem; }
.tva-field small { color: var(--tv-muted); font-weight: 400; }
.tva-new-actions { display: flex; gap: .5rem; }
.tva-new-actions .primary { flex: 1; }
.tva-error { color: var(--tv-danger); font-size: .87rem; font-weight: 600; }

.tva-empty { margin: 1rem 0 .25rem; color: var(--tv-muted); font-size: .9rem; text-align: center; }
.tva-list { list-style: none; margin: 1rem 0 0; padding: 0; display: grid; gap: .75rem; }
.tva-item { display: flex; gap: .85rem; padding: .6rem; border: 1px solid var(--tv-border); border-radius: var(--tv-radius); }
.tva-item.is-off, .tva-item.is-ended { background: var(--tv-surface-muted); }
.tva-item.is-off .tva-thumb img, .tva-item.is-ended .tva-thumb img { opacity: .45; }
.tva-meta { flex-wrap: wrap; }
.tva-pics { flex: 0 0 132px; display: grid; gap: .35rem; align-self: flex-start; }
.tva-thumb { position: relative; width: 100%; aspect-ratio: 16 / 9; padding: 0; border: 0; border-radius: var(--tv-radius-sm); background: #111; overflow: hidden; cursor: zoom-in; }
.tva-thumb-tr span { position: absolute; bottom: 4px; inset-inline-start: 4px; padding: 0 .4rem; border-radius: var(--tv-pill); background: rgba(0, 0, 0, .7); color: #fff; font-size: .68rem; font-weight: 600; }
.tva-thumb img { width: 100%; height: 100%; object-fit: contain; display: block; }
.tva-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .3rem; }
.tva-name { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tva-meta { display: flex; align-items: center; gap: .5rem; font-size: .8rem; color: var(--tv-muted); }
.tva-chip { padding: .05rem .55rem; border-radius: var(--tv-pill); font-weight: 600; }
.tva-chip.live { background: var(--tv-success-bg); color: var(--tv-success); }
.tva-chip.off, .tva-chip.ended { background: var(--tv-surface); color: var(--tv-muted); border: 1px solid var(--tv-border); }
.tva-actions { display: flex; gap: .35rem; flex-wrap: wrap; margin-top: .15rem; }
.tva-actions form { margin: 0; }
.tva-actions .tvd-btn { min-height: 36px; padding: 0 .65rem; font-size: .83rem; }
.tva-del { color: var(--tv-danger); width: 36px; padding: 0 !important; }
@media (max-width: 419.98px) { .tva-pics { flex-basis: 96px; } }
.tva-timing { margin-top: 1.25rem; padding-top: 1rem; border-top: 1px solid var(--tv-border); }
.tva-timing .tvd-field:last-child { margin-bottom: 0; }

/* As the mosque sees it */
.tva-lightbox { position: fixed; inset: 0; z-index: 1090; padding: 20px; box-sizing: border-box; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 20px; background: rgba(0, 0, 0, .75); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.tva-lightbox[hidden] { display: none; }
.tva-lightbox img { flex: 1; min-height: 0; max-width: 100%; object-fit: contain; border-radius: 20px; box-shadow: 0 20px 50px rgba(0, 0, 0, .3); }
/* One part per image (the translation's part only when there is one), each as long as its time */
.tva-lightbox-bar { width: 100%; height: 10px; flex-shrink: 0; display: flex; gap: 6px; }
.tva-lightbox-bar > span { flex: 1 1 0; border-radius: 5px; overflow: hidden; background: rgba(255, 255, 255, .3); }
.tva-lightbox-bar > span[hidden] { display: none; }
.tva-lightbox-bar i { display: block; width: 0; height: 100%; background: #4cc9f0; }
.tva-lightbox-close { position: absolute; top: max(14px, env(safe-area-inset-top)); left: 14px; width: 44px; height: 44px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .18); color: #fff; font-size: 1.1rem; display: grid; place-items: center; }
.tva-same { white-space: nowrap; font-size: .8rem; }

/* The section itself, inside index.html's scrolling .content-area (so sticky offsets start at 0) */
#section-tv { --tvd-top: 0px; padding-bottom: 1rem; }
.tv-page-head { margin-bottom: 1.25rem; }
.tv-page-head h2 { font-size: 1.35rem; font-weight: 800; color: var(--tv-text); display: flex; align-items: center; gap: .5rem; }
.tv-page-head h2 i { color: var(--tv-brand); }
.tv-page-head p { color: var(--tv-muted); font-size: .9rem; margin-top: .2rem; }
.tv-card { background: var(--tv-surface); border: 1px solid var(--tv-border); border-radius: var(--tv-radius); padding: 1.25rem; box-shadow: var(--tv-shadow-sm); }
.tv-card .tv-divider { margin: 1.5rem 0 1.25rem; }
.tvd-head h2 { font-weight: 800; color: var(--tv-text); display: flex; align-items: center; gap: .5rem; }
.tvd-head h2 i { color: var(--tv-brand); }
#section-tv .ltr { direction: ltr; unicode-bidi: isolate; }
#section-tv .tvd-full-btn, #section-tv .tva-thumb, #section-tv .tvd-quick-item button, #section-tv .tvd-quick-close, #section-tv .tva-tr-remove { cursor: pointer; }
.tva-lightbox-close { cursor: pointer; }
@media (max-width: 768px) {
    #section-tv { --tv-content-pad: 1rem; }
}
