/* Atribut hidden mora da pobedi display iz klasa (odbrojavanje, sat). */
[hidden] { display: none !important; }
/* BillPrompter Studio — studijski rundown: svetla radna povrsina, crni telefon,
   tally crvena samo za "u eteru" (play/snimanje), jantar i zelena za vreme. */
:root {
  --canvas: #eceef2;
  --panel: #ffffff;
  --ink: #15171c;
  --muted: #5b6170;
  --line: #d9dce3;
  --tally: #e0301e;
  --over: #b7791f;
  --under: #1f8a52;
  --focus: #2b59ff;
  --radius: 14px;
  font-family: "Instrument Sans", system-ui, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --canvas: #111318; --panel: #1a1d24; --ink: #eef0f5; --muted: #a2a8b8; --line: #2c313c; color-scheme: dark; }
}
:root[data-theme="dark"] { --canvas: #111318; --panel: #1a1d24; --ink: #eef0f5; --muted: #a2a8b8; --line: #2c313c; color-scheme: dark; }

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--canvas); color: var(--ink); font-size: 15px; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
h2 { font-size: 15px; font-weight: 700; margin: 0; }

/* ---------- vrh */
.top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 12px 20px; background: var(--panel); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; white-space: nowrap; }
.tally { width: 10px; height: 10px; border-radius: 50%; background: var(--tally); box-shadow: 0 0 0 3px color-mix(in srgb, var(--tally) 20%, transparent); }
.title { flex: 1 1 200px; min-width: 0; border: 1px solid transparent; border-radius: 10px; padding: 7px 10px; background: transparent; font-size: 17px; font-weight: 600; }
.title:hover, .title:focus { border-color: var(--line); }
.total { display: flex; align-items: baseline; gap: 6px; }
.total .label { color: var(--muted); font-size: 13px; }
.total strong { font-size: 20px; font-variant-numeric: tabular-nums; }
.actions { display: flex; gap: 6px; flex-wrap: wrap; }
.quiet { border: 1px solid var(--line); background: var(--panel); border-radius: 10px; padding: 7px 12px; cursor: pointer; }
.quiet:hover { border-color: var(--muted); }
.quiet.danger { color: var(--tally); }
.file { display: inline-flex; align-items: center; }

/* ---------- raspored */
.grid { display: grid; grid-template-columns: minmax(250px, 300px) minmax(0, 1fr) 380px; gap: 18px; padding: 18px 20px 40px; align-items: start; }
@media (max-width: 1180px) { .grid { grid-template-columns: minmax(240px, 280px) minmax(0, 1fr); } .preview { grid-column: 1 / -1; } }
@media (max-width: 760px) { .grid { grid-template-columns: 1fr; padding: 14px 16px 32px; } .top { padding: 10px 16px; } }
.card, .rundown { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }

/* ---------- rundown */
.rundown { padding: 14px; position: sticky; top: 78px; }
@media (max-width: 1180px) { .rundown { position: static; } }
.panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.add { border: 0; background: var(--ink); color: var(--panel); border-radius: 10px; padding: 7px 12px; font-weight: 600; cursor: pointer; }
.rows { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.rows li { display: grid; grid-template-columns: 26px 1fr auto; gap: 10px; align-items: center; padding: 9px 10px; border-radius: 10px; cursor: pointer; border: 1px solid transparent; }
.rows li:hover { background: color-mix(in srgb, var(--ink) 5%, transparent); }
.rows li[aria-current="true"] { border-color: var(--ink); background: color-mix(in srgb, var(--ink) 6%, transparent); }
.rows li.live .n { background: var(--tally); color: #fff; }
.n { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; font-size: 13px; font-weight: 700; background: color-mix(in srgb, var(--ink) 9%, transparent); font-variant-numeric: tabular-nums; }
.who { min-width: 0; }
.who strong { display: block; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who small { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.len { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.len small { display: block; font-weight: 500; font-size: 11px; }
.len small.over { color: var(--over); } .len small.under { color: var(--under); }

/* ---------- editor */
.editor { display: grid; gap: 18px; min-width: 0; }
.card { padding: 16px; }
label { display: grid; gap: 6px; font-size: 13px; color: var(--muted); }
input:not([type]), input[type="number"], select, textarea {
  border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; background: var(--canvas); color: var(--ink); font-size: 15px; width: 100%; }
textarea { resize: vertical; line-height: 1.5; min-height: 160px; }
#sText { font-size: 17px; }
.field-row { display: flex; gap: 12px; flex-wrap: wrap; align-items: end; margin: 12px 0; }
.field-row label { flex: 0 1 150px; }
.field-row .grow { flex: 1 1 220px; }
.seg-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.icon { width: 36px; height: 36px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); cursor: pointer; }
.stats { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; min-height: 1.3em; margin-top: 6px; }
.stats b { color: var(--ink); }

.settings h2 { margin-bottom: 10px; }
.set-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; align-items: start; }
fieldset { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px 12px; margin: 0; display: grid; gap: 10px; align-content: start; }
legend { padding: 0 6px; font-weight: 700; font-size: 13px; }
output { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; float: right; }
input[type="range"] { width: 100%; accent-color: var(--ink); }
.check { display: flex; align-items: center; gap: 8px; color: var(--ink); font-size: 14px; }
.inline { display: flex; align-items: center; justify-content: space-between; }
input[type="color"] { width: 44px; height: 30px; border: 1px solid var(--line); border-radius: 8px; padding: 2px; background: var(--panel); }

/* ---------- preview: telefon (390 x 844 tacaka, kao iPhone) */
.preview { position: sticky; top: 78px; display: grid; gap: 12px; justify-items: center; }
@media (max-width: 1180px) { .preview { position: static; } }
.phone { width: 340px; aspect-ratio: 390 / 844; border-radius: 48px; padding: 10px; background: #0b0b0d;
  box-shadow: 0 0 0 1px #2a2c33, 0 30px 60px -30px rgba(0, 0, 0, 0.55); }
@media (max-width: 400px) { .phone { width: calc(100vw - 32px); } }
.screen { position: relative; width: 390px; height: 844px; transform-origin: top left; border-radius: 40px; overflow: hidden; background: #000; color: #fff;
  font-family: -apple-system, "SF Pro Display", system-ui, sans-serif; }
.camera { position: absolute; left: 0; right: 0; top: 50%; transform: translateY(-50%); aspect-ratio: 16 / 9;
  background: radial-gradient(120% 90% at 50% 40%, #3a4150 0%, #1b1f27 60%, #0e1015 100%); display: grid; place-items: center; }
.camera span { font-size: 12px; letter-spacing: 0.04em; color: rgba(255, 255, 255, 0.35); }
.dim { position: absolute; inset: 0; background: #000; pointer-events: none; }
.prompter { position: absolute; inset: 0; overflow: hidden; pointer-events: none;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 10%, #000 80%, transparent 93%);
          mask-image: linear-gradient(to bottom, transparent 0%, #000 10%, #000 80%, transparent 93%); }
.text { position: absolute; left: 50%; transform-origin: center top; font-weight: 700; text-shadow: 0 1px 5px rgba(0, 0, 0, 0.85); white-space: pre-wrap; overflow-wrap: anywhere; }
.text .seg-title { display: block; font-size: 0.42em; font-weight: 600; opacity: 0.6; margin-bottom: 0.3em; }
.text .seg { display: block; padding-bottom: 1.1em; }
.reading { position: absolute; left: 12px; right: 12px; height: 2px; background: rgba(224, 48, 30, 0.75); pointer-events: none; }
.countdown { position: absolute; inset: 0; display: grid; place-items: center; font-size: 140px; font-weight: 800; color: #fff; text-shadow: 0 2px 20px rgba(0, 0, 0, 0.6); pointer-events: none; }
.chrome { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: space-between; padding: 56px 14px 26px; pointer-events: none; }
.chrome button { pointer-events: auto; }
.clock { align-self: flex-end; display: flex; align-items: center; gap: 6px; padding: 7px 10px; border-radius: 999px; background: rgba(0, 0, 0, 0.5); font-weight: 600; font-size: 15px; font-variant-numeric: tabular-nums; }
.clock i { width: 9px; height: 9px; border-radius: 50%; background: #ff3b30; }
.bar { margin-top: auto; display: grid; grid-template-columns: 1fr 1fr 1fr; align-items: center; }
.col { display: flex; justify-content: center; align-items: center; gap: 4px; }
.round { width: 36px; height: 36px; border-radius: 50%; border: 0; background: rgba(0, 0, 0, 0.5); color: #fff; font-size: 15px; font-weight: 700; cursor: pointer; }
.round.small { font-size: 11px; }
.num { font-size: 13px; font-weight: 600; min-width: 26px; text-align: center; font-variant-numeric: tabular-nums; }
.record { width: 76px; height: 76px; border-radius: 50%; border: 4px solid #fff; background: transparent; display: grid; place-items: center; cursor: pointer; padding: 0; }
.record i { width: 62px; height: 62px; border-radius: 31px; background: #ff3b30; transition: all 0.25s cubic-bezier(0.3, 1.4, 0.5, 1); }
.record.on i { width: 30px; height: 30px; border-radius: 8px; }

.transport { width: 340px; max-width: 100%; display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; }
.play { border: 0; border-radius: 10px; padding: 8px 14px; background: var(--tally); color: #fff; font-weight: 700; cursor: pointer; min-width: 72px; }
.time { font-variant-numeric: tabular-nums; font-size: 13px; color: var(--muted); white-space: nowrap; }
.jumps { width: 340px; max-width: 100%; display: flex; flex-wrap: wrap; gap: 6px; }
.jumps button { border: 1px solid var(--line); background: var(--panel); border-radius: 999px; padding: 5px 10px; font-size: 12px; cursor: pointer; }
.jumps button.live { border-color: var(--tally); color: var(--tally); }
.hint { width: 340px; max-width: 100%; margin: 0; font-size: 12px; color: var(--muted); }

@media (prefers-reduced-motion: reduce) { .record i { transition: none; } }
