:root {
  --bg: #0c0e12;
  --panel: #13161c;
  --panel-2: #191d25;
  --panel-3: #222836;
  --line: #262b36;
  --line-2: #343b49;
  --text: #e6e9ef;
  --text-2: #a3acba;
  --text-3: #8892a4;
  --accent: #f2b32c;        /* IN/OUT araligi, ana eylem */
  --accent-ink: #1a1405;
  --tally: #ee4b3c;         /* sadece gercek canli */
  --ok: #4cc38a;
  --bad: #ff8a7c;
  --warn-bg: #241e0f;
  --warn-line: #54421a;
  --warn-text: #e3c783;
  --track: #0f1218;
  --rec: #28344a;
  --rec-edge: #6c88b8;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.4 var(--sans); font-variant-numeric: tabular-nums; }
::selection { background: color-mix(in srgb, var(--accent) 35%, transparent); }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.mono, .tc { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.ic { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; flex: none; }
::placeholder { color: var(--text-3); opacity: 1; }
input { caret-color: var(--accent); }

/* ---------- Giris ---------- */
.login-body { display: grid; place-items: center; }
.login { width: min(360px, 92vw); padding: 32px 28px 24px; background: var(--panel); border: 1px solid var(--line); border-radius: 6px; }
.brand { margin: 0; font-size: 28px; letter-spacing: .14em; font-weight: 700; }
.sub { margin: 4px 0 24px; color: var(--text-2); }
.login form { display: grid; gap: 6px; }
.login label { color: var(--text-2); font-size: 13px; margin-top: 8px; }
.login input { background: var(--bg); border: 1px solid var(--line-2); border-radius: 4px; padding: 10px 12px; font-size: 16px; }
.login input:focus { border-color: var(--accent); outline: none; }
.login .btn { margin-top: 18px; padding: 11px; }
.err { margin: 10px 0 0; color: var(--bad); font-size: 13px; }
.notice { margin: 22px 0 0; color: var(--text-3); font-size: 12px; text-align: center; }

/* ---------- Butonlar ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; background: var(--panel-2); border: 1px solid var(--line-2); border-radius: 4px; padding: 7px 12px; line-height: 1.2; transition: background-color .15s var(--ease), border-color .15s var(--ease), color .15s var(--ease); }
.btn:hover:not(:disabled) { background: #212632; border-color: #46506a; }
.btn:active:not(:disabled) { background: #161a22; border-color: #46506a; }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.btn.primary:hover:not(:disabled) { background: #ffc545; border-color: #ffc545; }
.btn.primary:active:not(:disabled) { background: #d99f1f; border-color: #d99f1f; }
.btn.sm { padding: 4px 9px; font-size: 12.5px; }
.btn.icon { padding: 0; width: 32px; height: 32px; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn.ghost:hover:not(:disabled) { background: var(--panel-2); color: var(--text); border-color: var(--line); }
kbd { font-family: var(--mono); font-size: 11px; background: var(--panel-2); border: 1px solid var(--line-2); border-radius: 3px; padding: 0 5px; color: var(--text-2); line-height: 1.5; }

/* ---------- Ust cubuk ---------- */
.top { height: 44px; display: flex; align-items: center; gap: 16px; padding: 0 14px; border-bottom: 1px solid var(--line); background: var(--panel); }
.top .brand { font-size: 15px; }
.top .notice { margin: 0; font-size: 12px; text-align: left; flex: 1; }
.top .who { color: var(--text-2); font-size: 13px; }
.top form { margin: 0; }

/* ---------- Ana yerlesim ---------- */
.app { height: 100vh; min-height: 640px; display: grid; grid-template-rows: 44px minmax(0, 1fr); }
.main { min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 348px; }
.left { min-width: 0; min-height: 0; display: flex; flex-direction: column; padding: 10px 14px 8px; gap: 8px; }
.right { min-height: 0; border-left: 1px solid var(--line); background: var(--panel); padding: 12px 14px; overflow: auto; display: flex; flex-direction: column; gap: 14px; }

/* ---------- Uyari seridi (bilgi, hata degil) ---------- */
.banner { display: flex; align-items: center; gap: 8px; padding: 3px 4px 3px 10px; background: var(--warn-bg); border: 1px solid var(--warn-line); border-radius: 4px; color: var(--warn-text); font-size: 12.5px; }
.banner span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.banner .btn.icon { width: 26px; height: 26px; color: var(--warn-text); }
.banner[hidden] { display: none; }

/* ---------- Oynatici ---------- */
.stagewrap { flex: 1 1 0; min-height: 180px; container-type: size; display: grid; place-items: center; }
.stage { position: relative; background: #000; border: 1px solid var(--line); border-radius: 3px; width: min(100cqw, 100cqh * 16 / 9); aspect-ratio: 16 / 9; overflow: hidden; }
.stage video { width: 100%; height: 100%; display: block; background: #000; }
.badge { position: absolute; top: 10px; left: 10px; display: flex; align-items: center; gap: 8px; padding: 4px 10px; background: rgba(12,14,18,.88); border-radius: 3px; font-size: 12px; font-weight: 700; letter-spacing: .08em; color: var(--text-2); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-3); flex: none; }
.badge[data-state="live"] { color: var(--text); }
.badge[data-state="live"] .dot { background: var(--tally); }
.badge[data-state="rec"] { color: var(--text); }
.badge[data-state="rec"] .dot { background: var(--rec-edge); }
.badge[data-state="prev"] { color: var(--accent); }
.badge[data-state="prev"] .dot { background: var(--accent); }
.clock { position: absolute; top: 10px; right: 10px; padding: 3px 10px; background: rgba(12,14,18,.88); color: var(--text); border-radius: 3px; font-size: 18px; letter-spacing: .02em; }
.ovl { position: absolute; inset: 0; display: none; place-items: center; text-align: center; padding: 24px; background: rgba(12,14,18,.9); }
.ovl.show { display: grid; }
.ovl.thin { background: rgba(12,14,18,.62); }
.ovl-body { max-width: 440px; color: var(--text-2); font-size: 14px; text-wrap: balance; }
.ovl-body strong { color: var(--text); font-weight: 600; }
.ovl-body .spin { margin-right: 8px; }

/* ---------- Kontrol cubugu ---------- */
.ctrl { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.grp { display: flex; align-items: center; gap: 8px; min-width: 0; }
.livebtn { display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 12px; border-radius: 4px; border: 1px solid var(--line-2); background: var(--panel-2); color: var(--text-2); font-weight: 700; font-size: 12.5px; letter-spacing: .06em; transition: background-color .15s var(--ease), border-color .15s var(--ease), color .15s var(--ease); white-space: nowrap; }
.livebtn:hover { background: #212632; border-color: #46506a; color: var(--text); }
.livebtn:active { background: #161a22; }
.livebtn[data-state="live"] { color: var(--text); border-color: #7a2f29; background: #2a1613; }
.livebtn[data-state="live"] .dot { background: var(--tally); }
.behind { color: var(--text-2); font-size: 12.5px; white-space: nowrap; }
.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: 4px; overflow: hidden; }
.segb { background: var(--panel-2); border: 0; border-right: 1px solid var(--line-2); padding: 0 11px; height: 30px; font-size: 12.5px; color: var(--text-2); transition: background-color .15s var(--ease), color .15s var(--ease); }
.segb:last-child { border-right: 0; }
.segb:hover { background: #212632; color: var(--text); }
.segb:active { background: #161a22; }
.segb.on { background: var(--panel-3); color: var(--text); box-shadow: inset 0 -2px 0 var(--accent); }
.segb:focus-visible { outline-offset: -2px; }
.vsep { width: 1px; height: 20px; background: var(--line-2); margin: 0 4px; }
.vol { width: 80px; accent-color: var(--accent); }

/* ---------- Zaman cizelgesi ---------- */
.tl2 { display: grid; gap: 6px; }
.dt { position: relative; height: 96px; background: var(--track); border: 1px solid var(--line); border-radius: 3px; overflow: hidden; touch-action: none; user-select: none; -webkit-user-select: none; cursor: crosshair; }
.dt canvas, .ov canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; pointer-events: none; }
.dt.panning { cursor: grabbing; }
.rng { position: absolute; top: 24px; bottom: 0; left: 0; width: 0; background: color-mix(in srgb, var(--accent) 22%, transparent); border-top: 2px solid var(--accent); border-bottom: 2px solid var(--accent); cursor: grab; display: none; will-change: transform; }
.rng.on { display: block; }
.dt.dragging-body .rng { cursor: grabbing; }
.hd { position: absolute; top: 0; bottom: 0; left: 0; width: 16px; margin-left: -8px; cursor: ew-resize; display: none; z-index: 5; outline-offset: -2px; will-change: transform; }
.hd.on { display: block; }
.hd .bar { position: absolute; top: 0; bottom: 0; left: 6px; width: 4px; background: var(--accent); border-radius: 1px; transition: background-color .15s var(--ease); }
.hd:hover .bar, .hd.dragging .bar { background: #ffd56e; }
.hd .chip { position: absolute; top: 28px; padding: 1px 6px; background: var(--accent); color: var(--accent-ink); font-size: 11.5px; font-weight: 700; border-radius: 2px; white-space: nowrap; pointer-events: none; }
.hd-in .chip { right: 12px; }
.hd-out .chip { left: 12px; top: 52px; }
.hd-in.flip .chip { right: auto; left: 12px; }
.hd-out.flip .chip { left: auto; right: 12px; }
.ph { position: absolute; top: 0; height: 24px; left: 0; width: 18px; margin-left: -9px; cursor: ew-resize; z-index: 2; will-change: transform; }
.ph::before { content: ""; position: absolute; top: 0; height: 96px; left: 8px; width: 2px; background: var(--text); pointer-events: none; }
.ph .flag { position: absolute; top: 0; left: 3px; width: 12px; height: 11px; background: var(--text); clip-path: polygon(0 0, 100% 0, 100% 55%, 50% 100%, 0 55%); }
.hov { position: absolute; top: 0; bottom: 0; left: 0; width: 1px; background: rgba(230,233,239,.35); pointer-events: none; display: none; z-index: 2; will-change: transform; }
.hov span { position: absolute; bottom: 4px; left: 6px; padding: 1px 6px; background: var(--panel-3); border: 1px solid var(--line-2); border-radius: 3px; font-size: 11.5px; color: var(--text); white-space: nowrap; }
.hov.flip span { left: auto; right: 6px; }
.dt:hover .hov.on { display: block; }
.ov { position: relative; height: 38px; background: var(--track); border: 1px solid var(--line); border-radius: 3px; overflow: hidden; touch-action: none; user-select: none; -webkit-user-select: none; cursor: pointer; }
.ov-br { position: absolute; top: 1px; bottom: 1px; left: 0; width: 8px; border: 1.5px solid var(--text); background: rgba(230,233,239,.12); border-radius: 2px; cursor: grab; will-change: transform; }
.ov-sel { position: absolute; bottom: 1px; height: 5px; left: 0; width: 3px; background: var(--accent); display: none; will-change: transform; pointer-events: none; }
.ov-ph { position: absolute; top: 0; bottom: 0; left: 0; width: 2px; background: var(--text); pointer-events: none; will-change: transform; }
.tl-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 22px; }
.hint { margin: 0; color: var(--text-3); font-size: 12px; }
.hint kbd { margin: 0 3px 0 8px; }
.hint kbd:first-child { margin-left: 0; }
.tlmsg { color: var(--accent); font-size: 12.5px; white-space: nowrap; opacity: 0; transition: opacity .15s var(--ease); }
.tlmsg.show { opacity: 1; }

/* ---------- Sag panel ---------- */
.sec { display: grid; gap: 8px; align-content: start; }
.sec h2 { margin: 0; font-size: 13px; font-weight: 600; color: var(--text-2); }
.sec-h { display: flex; align-items: center; justify-content: space-between; min-height: 28px; }
.sec-h .btn { margin-right: -6px; }
.mark-top .btn { white-space: nowrap; }
.mark { display: grid; gap: 6px; padding: 8px 10px; background: var(--bg); border: 1px solid var(--line); border-radius: 4px; }
.mark-top { display: flex; align-items: center; gap: 10px; }
.tag { width: 34px; font-weight: 700; color: var(--accent); font-size: 13px; letter-spacing: .04em; }
.tcbig { flex: 1; font-size: 22px; white-space: nowrap; line-height: 1.15; letter-spacing: .01em; }
.mark-act { display: grid; grid-template-columns: 1fr 1fr 1.5fr; gap: 6px; }
.mark-act .btn { padding: 4px 6px; white-space: nowrap; }
.dur { display: flex; align-items: baseline; justify-content: space-between; padding: 6px 12px 2px; }
.dur .dl { color: var(--text-2); font-size: 13px; }
.dur .dv { font-size: 34px; line-height: 1.1; font-weight: 500; }
.dur.bad .dv { color: var(--bad); }
.durnote { margin: -4px 0 0; padding: 0 12px; font-size: 12.5px; color: var(--warn-text); }
.durnote:empty { display: none; }
.field { display: grid; gap: 5px; }
.field label { color: var(--text-2); font-size: 13px; }
.field input { background: var(--bg); border: 1px solid var(--line-2); border-radius: 4px; padding: 8px 10px; transition: border-color .15s var(--ease); }
.field input:hover { border-color: #46506a; }
.field input:focus { border-color: var(--accent); outline: none; }
.fnprev { margin: 0; font-size: 12px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.actions { display: grid; gap: 8px; }
.actions .btn { padding: 9px 12px; }
.actions .big { padding: 12px; font-size: 15px; }
.actions .btn small { font-weight: 400; opacity: .8; font-size: 12px; }
.actions .btn kbd { margin-left: 4px; }
.note { font-size: 11.5px; line-height: 1.45; }
.dlstate { min-height: 0; font-size: 13px; color: var(--text-2); }
.dlstate:empty { display: none; }
.dlrow { display: flex; align-items: center; gap: 8px; }
.dlrow .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dlstate.err { color: var(--bad); }
.dlstate.ok { color: var(--ok); }
.bar-track { height: 4px; margin-top: 6px; background: var(--panel-3); border-radius: 2px; overflow: hidden; }
.bar-fill { height: 100%; width: 0; background: var(--accent); transform-origin: left; }
.bar-fill.ind { width: 35%; animation: ind 1.2s linear infinite; }
@keyframes ind { from { transform: translateX(-100%); } to { transform: translateX(300%); } }
.spin { display: inline-block; width: 11px; height: 11px; border: 2px solid var(--line-2); border-top-color: var(--accent); border-radius: 50%; animation: sp .8s linear infinite; vertical-align: -1px; flex: none; }
@keyframes sp { to { transform: rotate(360deg); } }

.recent { flex: 1; min-height: 80px; grid-template-rows: auto minmax(0, 1fr); }
.rlist { list-style: none; margin: 0; padding: 0; overflow: auto; display: grid; align-content: start; }
.rlist li { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-top: 1px solid var(--line); }
.rlist .rmeta { flex: 1; min-width: 0; }
.rlist .rname { font-family: var(--mono); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rlist .rsub { font-size: 12px; color: var(--text-2); }
.rempty { color: var(--text-3); font-size: 12.5px; padding: 6px 0; border-top: 1px solid var(--line); }

@media (prefers-reduced-motion: reduce) { .spin, .bar-fill.ind { animation-duration: 2.4s; } .btn, .segb, .livebtn, .hd .bar, .tlmsg { transition: none; } }

@media (max-width: 1360px) { .hint .opt { display: none; } .main { grid-template-columns: minmax(0, 1fr) 328px; } .hint { font-size: 11.5px; } .vol { width: 56px; } }
@media (max-width: 1180px) { .vol { display: none; } .behind { display: none; } }
@media (max-width: 980px) {
  .app { height: auto; min-height: 100vh; }
  .main { grid-template-columns: 1fr; }
  .stagewrap { flex: none; height: 56vw; }
  .right { border-left: 0; border-top: 1px solid var(--line); }
  .top .notice { display: none; }
  .top .brand { flex: 1; }
}
