:root { --bg:#f3f4f6; --card:#fff; --line:#d9dce3; --ink:#1b2230; --dim:#667085; --accent:#2457d6; --danger:#c62828; }
* { box-sizing: border-box; }
body { margin:0; font-family: system-ui, "Segoe UI", Arial, sans-serif; background:var(--bg); color:var(--ink); }
header { background:var(--ink); color:#fff; padding:12px 16px; display:flex; align-items:center; gap:12px; flex-wrap:wrap; position:sticky; top:0; z-index:5; }
header h1 { font-size:18px; margin:0; flex:1; white-space:nowrap; }
main { max-width:820px; margin:0 auto; padding:16px; }
button, select, input, textarea { font:inherit; }
button { border:1px solid var(--line); background:#fff; color:var(--ink); border-radius:8px; padding:8px 12px; cursor:pointer; }
button.primary { background:var(--accent); border-color:var(--accent); color:#fff; }
button.danger { color:var(--danger); }
button.sm { padding:6px 10px; }
header button, header select { background:transparent; color:#fff; border-color:#566; }
header select option { color:#000; }
input[type=text], input[type=email], input[type=password], input[type=url], input[type=number], input[type=time], textarea, select {
  border:1px solid var(--line); border-radius:8px; padding:8px 10px; background:#fff; color:var(--ink); width:100%; }
input[type=number] { width:80px; }
input[type=time] { width:auto; }
input[type=color] { width:44px; height:34px; padding:2px; border:1px solid var(--line); border-radius:8px; background:#fff; vertical-align:middle; }
textarea { resize:vertical; }
.card { background:var(--card); border:1px solid var(--line); border-radius:12px; padding:12px; margin-bottom:12px; }
.card.off { opacity:.55; }
.head { display:flex; align-items:center; gap:8px; flex-wrap:wrap; margin-bottom:10px; }
.head .num { font-weight:700; min-width:22px; }
.head select { width:auto; }
.head .sp { flex:1; }
.fields { display:grid; gap:8px; }
.row { display:flex; gap:14px; align-items:center; flex-wrap:wrap; }
label { color:var(--dim); font-size:14px; display:inline-flex; align-items:center; gap:6px; }
.thumb { max-width:160px; max-height:90px; border-radius:6px; border:1px solid var(--line); display:block; }
.add { display:flex; gap:8px; flex-wrap:wrap; margin:16px 0; }
#preview { position:relative; width:100%; aspect-ratio:16/9; background:#000; border-radius:12px; overflow:hidden; margin-bottom:16px; }
#preview iframe { position:absolute; inset:0; width:100%; height:100%; border:0; pointer-events:none; }
#login { max-width:340px; margin:60px auto; display:grid; gap:10px; }
#err { color:var(--danger); min-height:1.2em; }
#status { font-size:13px; color:#9fb0c8; }
.hidden { display:none !important; }
#tvState { font-size:13px; }
#tvState::before { content:'● '; color:#98a2b3; }
#tvState.ok::before { color:#12b76a; }
#tvState.bad::before { color:#f04438; }
header button.on { background:#f79009; border-color:#f79009; }
.card.live { border-color:#12b76a; box-shadow:0 0 0 2px #12b76a55; }
.card.live .num::after { content:' ● בטלוויזיה'; color:#12b76a; font-size:12px; font-weight:400; }
.grip { cursor:grab; color:var(--dim); font-size:18px; user-select:none; padding:0 4px; }
.card.dragging { opacity:.4; }
details summary { cursor:pointer; color:var(--dim); font-size:14px; }
details[open] summary { margin-bottom:8px; }
.tpl { border-top:1px solid var(--line); padding:10px 0; display:grid; gap:8px; }
