* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: #0e1116; color: #e8eaed;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
button, input { font: inherit; }
button { border: 0; border-radius: 10px; padding: 12px 16px; background: #2a3140; color: #fff; cursor: pointer; }
button.primary { background: #1f6feb; }
button.danger { background: #c62828; }
button.off { background: #7a4a00; }
button:disabled { opacity: .5; }
body.needlogin > :not(#login):not(script) { display: none !important; }
input[type=text], input[type=password] { width: 100%; padding: 12px; border-radius: 10px; border: 1px solid #39414f;
  background: #161b22; color: #fff; }
.hidden { display: none !important; }
.err { color: #ff8a80; min-height: 1.4em; margin: 8px 0; }

/* reporter */
.join { max-width: 420px; margin: 0 auto; padding: 24px 16px; display: flex; flex-direction: column; gap: 14px; }
.join h1 { font-size: 22px; margin: 12px 0 0; }
.join p { margin: 0; color: #9aa4b2; }
.setup { display: flex; flex-direction: column; gap: 14px; }
.pv { width: 100%; aspect-ratio: 16/9; background: #000; border-radius: 10px; object-fit: contain; }
.pv.mirror { transform: scaleX(-1); }
.meter { height: 8px; background: #222a36; border-radius: 4px; overflow: hidden; }
#lvl { height: 100%; width: 0; background: #7ee787; }
.join label { display: flex; flex-direction: column; gap: 6px; color: #9aa4b2; font-size: 14px; }
.join label.chk { flex-direction: row; align-items: center; gap: 8px; }
.join select { width: 100%; max-width: none; padding: 12px; font-size: 16px; }
.live { position: fixed; inset: 0; display: flex; flex-direction: column; background: #000; }
.stage { flex: 1; min-height: 0; position: relative; }
.stage > video { width: 100%; height: 100%; object-fit: contain; background: #000; display: block; }
.stage > video.mirror { transform: scaleX(-1); }
/* prozorcici: studio + ostali reporteri i gosti */
.thumbs { position: absolute; right: 10px; bottom: 10px; left: 10px; display: flex; gap: 6px;
  flex-wrap: wrap-reverse; justify-content: flex-end; pointer-events: none; }
.thumb { position: relative; width: 112px; aspect-ratio: 16/9; background: #161b22; border-radius: 8px;
  overflow: hidden; border: 1px solid rgba(255,255,255,.3); }
.thumb video, .thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.thumb img { object-fit: contain; background: #77bc1f; }
.thumb.novideo video { display: none; }
.thumb span { position: absolute; left: 4px; bottom: 3px; max-width: 92%; padding: 1px 5px; border-radius: 4px;
  background: rgba(0,0,0,.65); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (min-width: 800px) { .thumb { width: 192px; } .thumb span { font-size: 13px; } }
.bar { display: flex; gap: 8px; padding: 10px; background: #0e1116; flex-wrap: wrap; }
.bar button { flex: 1; min-width: 96px; }
.status { position: absolute; top: 10px; left: 10px; right: 10px; display: flex; gap: 8px; pointer-events: none; }
.pill { padding: 6px 10px; border-radius: 999px; background: rgba(0,0,0,.65); font-size: 14px; }
.pill.ok { color: #7ee787; } .pill.warn { color: #f2cc60; } .pill.bad { color: #ff8a80; }

.pill.tally { background: #c62828; color: #fff; font-weight: 700; }
.live.onair { outline: 6px solid #c62828; outline-offset: -6px; }
.msg { position: absolute; left: 10px; right: 10px; top: 54px; padding: 12px 14px; border-radius: 10px;
  background: rgba(31,111,235,.92); color: #fff; font-size: 18px; }

/* studio */
select { padding: 8px; border-radius: 8px; border: 1px solid #39414f; background: #0e1116; color: #fff; max-width: 260px; }
.top label { font-size: 14px; color: #9aa4b2; white-space: nowrap; }
.tile.onair { outline: 3px solid #c62828; }
.tile video.mir, .out video.mir { transform: scaleX(-1); }
/* klizaci za korekciju slike */
.cc { flex: 1 1 100%; display: grid; grid-template-columns: auto 1fr 48px; gap: 6px 10px; align-items: center;
  padding: 8px 2px 2px; color: #9aa4b2; }
.cc input[type=range] { width: 100%; }
.cc .val { text-align: right; color: #e8eaed; }
.cc button { grid-column: 1 / -1; justify-self: start; }
/* prijava: slika sa znakovima */
.caprow { display: flex; gap: 8px; align-items: center; }
.caprow img { height: 46px; border-radius: 8px; background: #fff; cursor: pointer; }
.linkrow input.short { flex: 0 1 220px; min-width: 140px; width: auto; }
.linkrow .note { color: #9aa4b2; font-size: 13px; width: auto; }
.top { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: #161b22; flex-wrap: wrap; }
.top h1 { font-size: 16px; margin: 0; flex: 1; min-width: 160px; }
/* zaglavlje sa RT logom i nazivom sistema (isti izgled kao Newsdesk V2) */
.brand { display: flex; align-items: center; gap: 16px; flex: 1; min-width: 300px; color: #fff;
  font-family: Arial, "Helvetica Neue", Helvetica, system-ui, sans-serif; }
.brand img { width: 84px; height: 64px; padding: 0; background: #77bc1f; object-fit: contain; display: block; flex: none; }
.brand b { display: block; font-size: 19px; font-weight: 700; letter-spacing: .3px; line-height: 1.1; text-transform: uppercase; }
.brand small { display: block; margin-top: 5px; font-size: 10px; letter-spacing: .22em; color: #9a9a9a; text-transform: uppercase; }
.top { padding-top: 0; padding-bottom: 0; padding-left: 0; min-height: 64px; background: #0a0a0a;
  border-bottom: 3px solid #77bc1f; box-shadow: 0 2px 10px rgba(15,27,45,.2); }
.top button { padding: 8px 12px; }
/* najvise tri ukljucenja u redu; na uzem ekranu dva, pa jedno */
.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; padding: 10px; }
@media (max-width: 1200px) { .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 720px) { .grid { grid-template-columns: minmax(0, 1fr); } }
/* zaglavlje i pregled izlaza ostaju na vrhu dok se strana pomera */
.sticky { position: sticky; top: 0; z-index: 20; background: #0e1116; padding-bottom: 10px;
  box-shadow: 0 6px 12px rgba(0,0,0,.45); }
/* pregled izlaza (SDI 1-4) */
.outs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; padding: 10px 10px 0; }
@media (max-width: 900px) { .outs { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.out { background: #161b22; border-radius: 10px; padding: 8px 10px; display: flex; align-items: center; gap: 10px; border: 2px solid transparent; }
.out video { width: 128px; flex: none; aspect-ratio: 16/9; background: #000; border-radius: 6px; object-fit: contain; }
.out .ctl { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
@media (max-width: 1300px) { .out video { width: 96px; } }
.out.off { opacity: .45; }
.out.active { border-color: #2ea043; }
.out .hd { display: flex; align-items: center; justify-content: space-between; gap: 6px; font-weight: 600; font-size: 14px; }
.out select { width: 100%; max-width: none; }
.links { display: flex; flex-direction: column; gap: 8px; padding: 12px 14px; background: #161b22; border-top: 1px solid #2a3140; }
.linkrow { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.linkrow span { width: 190px; color: #9aa4b2; font-size: 14px; }
.linkrow input { flex: 1; min-width: 220px; padding: 8px; border-radius: 8px; border: 1px solid #39414f; background: #0e1116; color: #fff; }
.linkrow button { padding: 8px 12px; }
.tile { background: #000; border-radius: 10px; overflow: hidden; position: relative; }
.tile video { width: 100%; aspect-ratio: 16/9; display: block; background: #000; object-fit: contain; }
.tile .meta { display: flex; align-items: center; gap: 6px; padding: 8px 10px; background: #161b22; font-size: 14px; flex-wrap: wrap; }
.tile .meta .name { font-weight: 600; flex: 1 1 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile .meta select { padding: 6px; }
.tile .meta button { padding: 6px 10px; border-radius: 8px; }
.tile:fullscreen .meta { display: none; }
.tile:fullscreen video { width: 100vw; height: 100vh; aspect-ratio: auto; }
.empty { padding: 40px; text-align: center; color: #9aa4b2; }
/* prijava rezije: bela kartica sa crnim zaglavljem (isti izgled kao Newsdesk V2) */
body.needlogin { background: #0a0a0a; display: flex; align-items: center; justify-content: center; min-height: 100%; padding: 16px; }
.lcard { width: 100%; max-width: 440px; background: #fff; color: #111; box-shadow: 0 10px 40px rgba(0,0,0,.6);
  font-family: Arial, "Helvetica Neue", Helvetica, system-ui, sans-serif; }
.lhead { background: #000; border-bottom: 4px solid #77bc1f; }
.lhead .brand img { height: 68px; }
.lbody { padding: 28px 32px 30px; display: flex; flex-direction: column; }
.lbody h1 { margin: 0 0 6px; font-size: 24px; color: #111; }
.lbody p { margin: 0 0 16px; color: #666; font-size: 14px; }
.lbody label { font-weight: 700; font-size: 14px; margin: 0 0 6px; color: #111; }
.lbody input[type=text], .lbody input[type=password] { width: 100%; padding: 12px 13px; margin: 0 0 16px; border: 1px solid #cfcfcf;
  border-radius: 0; background: #fff; color: #111; font-size: 15px; }
.lbody input:focus { outline: 2px solid #77bc1f; outline-offset: 0; border-color: #77bc1f; }
.lbody .caprow { margin: 0 0 16px; }
.lbody .caprow img { height: 44px; width: auto; border: 1px solid #cfcfcf; border-radius: 0; }
.lbody .caprow input { margin: 0; }
.lbody button { margin-top: 6px; padding: 13px; border-radius: 0; background: #000; color: #fff; font-weight: 700; font-size: 15px; }
.lbody button:hover { background: #222; }
.lbody .err { color: #c62828; margin: 10px 0 0; }
.lbody .lnote { margin: 12px 0 0; text-align: center; font-size: 13px; color: #5f9a14; }