:root {
  --bg: #f6f6f8;
  --surface: #ffffff;
  --ink: #15161c;
  --muted: #666a78;
  --line: #e2e3ea;
  --accent: #4b3df2;
  --accent-ink: #ffffff;
  --accent-soft: #eceaff;
  --ok: #0d7a4f;
  --ok-soft: #dff5ea;
  --bad: #b3261e;
  --bad-soft: #fde7e5;
  --warn: #8a5a00;
  --warn-soft: #fff1d0;
  --run: #1757c7;
  --run-soft: #e3edff;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(20, 20, 40, .06), 0 4px 16px rgba(20, 20, 40, .04);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #101117;
    --surface: #181a22;
    --ink: #eef0f6;
    --muted: #9ba0b2;
    --line: #2a2d3a;
    --accent: #8b80ff;
    --accent-ink: #11121a;
    --accent-soft: #272444;
    --ok: #52d19a;
    --ok-soft: #12362a;
    --bad: #ff8a80;
    --bad-soft: #3d1c1a;
    --warn: #f2c14d;
    --warn-soft: #3a2f10;
    --run: #8fb4ff;
    --run-soft: #14284d;
    --shadow: none;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
a { color: var(--accent); }
h1 { font-size: 1.6rem; line-height: 1.2; margin: 0 0 .25rem; }
h2 { font-size: 1.15rem; margin: 0 0 .75rem; }
h3 { font-size: 1rem; margin: 0 0 .5rem; }
p { margin: 0 0 .75rem; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }

/* nagłówek */
.top { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.top .wrap { display: flex; align-items: center; gap: 16px; min-height: 56px; flex-wrap: wrap; padding-top: 6px; padding-bottom: 6px; }
.logo { font-weight: 800; font-size: 1.15rem; letter-spacing: -.02em; color: var(--ink); text-decoration: none; }
.logo span { color: var(--accent); }
.nav { display: flex; gap: 4px; flex-wrap: wrap; flex: 1; }
.nav a { padding: 8px 12px; border-radius: 8px; text-decoration: none; color: var(--muted); font-weight: 600; font-size: .95rem; }
.nav a:hover { background: var(--accent-soft); color: var(--ink); }
.nav a.on { background: var(--accent-soft); color: var(--accent); }
.who { display: flex; align-items: center; gap: 8px; font-size: .875rem; color: var(--muted); }
main { padding: 24px 0 64px; }
.head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }

/* elementy */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); margin-bottom: 16px; }
.card > :last-child { margin-bottom: 0; }
.grid { display: grid; gap: 16px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stat { font-size: 2rem; font-weight: 800; line-height: 1; margin-bottom: 4px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px;
  padding: 8px 16px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  font: inherit; font-weight: 600; cursor: pointer; text-decoration: none;
}
.btn:hover { border-color: var(--accent); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { color: var(--bad); }
.btn.sm { min-height: 32px; padding: 4px 10px; font-size: .875rem; border-radius: 8px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.inline { display: inline; margin: 0; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 4px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=datetime-local], input[type=file], select, textarea {
  width: 100%; min-height: 42px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--bg); color: var(--ink); font: inherit;
}
textarea { min-height: 120px; resize: vertical; }
input:focus, select:focus, textarea:focus, .btn:focus-visible, a:focus-visible { outline: 3px solid var(--accent-soft); outline-offset: 1px; border-color: var(--accent); }
.field { margin-bottom: 14px; }
.hint { font-size: .85rem; color: var(--muted); margin-top: 4px; }
.count { float: right; font-weight: 400; color: var(--muted); }
.count.over { color: var(--bad); font-weight: 700; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 500; margin-bottom: 8px; }
.check input { margin-top: 5px; width: 18px; height: 18px; flex: none; }

/* znaczki */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px; border-radius: 999px; font-size: .8rem; font-weight: 700; background: var(--line); color: var(--ink); white-space: nowrap; }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.bad { background: var(--bad-soft); color: var(--bad); }
.badge.warn, .badge.wait { background: var(--warn-soft); color: var(--warn); }
.badge.run { background: var(--run-soft); color: var(--run); }
.badge.mute { background: var(--line); color: var(--muted); }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; background: var(--line); }
.dot.ok { background: var(--ok); } .dot.bad { background: var(--bad); } .dot.wait { background: var(--warn); } .dot.run { background: var(--run); }

.flash { padding: 12px 16px; border-radius: 10px; margin-bottom: 16px; font-weight: 600; border: 1px solid transparent; }
.flash.ok { background: var(--ok-soft); color: var(--ok); }
.flash.bad { background: var(--bad-soft); color: var(--bad); white-space: pre-line; }
.flash.warn { background: var(--warn-soft); color: var(--warn); }

/* tabele */
.tablewrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .95rem; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
tr:last-child td { border-bottom: 0; }

/* konta */
.acc { display: flex; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.acc:last-child { border-bottom: 0; }
.acc .info { flex: 1; min-width: 180px; }
.avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--accent-soft); object-fit: cover; flex: none; display: grid; place-items: center; font-weight: 800; color: var(--accent); }
.plat { display: inline-grid; place-items: center; min-width: 28px; height: 28px; padding: 0 6px; border-radius: 8px; font-size: .75rem; font-weight: 800; color: #fff; background: #555; }
.plat.fb { background: #1877f2; } .plat.ig { background: #c13584; } .plat.yt { background: #e00; } .plat.tt { background: #111; } .plat.test { background: #777; }

/* wgrywanie */
.drop { border: 2px dashed var(--line); border-radius: var(--radius); padding: 28px 16px; text-align: center; cursor: pointer; background: var(--bg); }
.drop.over { border-color: var(--accent); background: var(--accent-soft); }
progress { width: 100%; height: 10px; accent-color: var(--accent); }
.checks { display: grid; gap: 8px; margin-top: 12px; }
.chk { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.chk .msg { font-size: .875rem; color: var(--muted); }
.chk.bad { border-color: var(--bad); }
.chk.ok { border-color: var(--ok-soft); }
.preview { display: grid; grid-template-columns: minmax(160px, 240px) 1fr; gap: 20px; align-items: start; }
.preview video, .preview img { width: 100%; max-height: 420px; border-radius: 12px; background: #000; object-fit: contain; }
.chan { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 8px; background: var(--surface); }
.chan input { width: 18px; height: 18px; flex: none; }
.chan.off { opacity: .55; }
.chan label { margin: 0; font-weight: 600; flex: 1; cursor: pointer; }
.sect { border-top: 1px solid var(--line); margin-top: 18px; padding-top: 18px; }
.tt-box { border: 1px solid var(--line); border-radius: 12px; padding: 16px; background: var(--bg); margin-bottom: 12px; }
.tt-user { display: flex; gap: 10px; align-items: center; margin-bottom: 12px; font-weight: 700; }
.tt-user img { width: 36px; height: 36px; border-radius: 50%; }
.step { counter-increment: step; }
.step > h2::before { content: counter(step); display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font-size: .85rem; margin-right: 8px; }
form.steps { counter-reset: step; }

/* kalendarz */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.cal .dow { background: var(--bg); padding: 8px; font-size: .75rem; font-weight: 700; text-transform: uppercase; color: var(--muted); text-align: center; }
.cal .day { background: var(--surface); min-height: 108px; padding: 6px; min-width: 0; }
.cal.week .day { min-height: 260px; }
.cal .day.out { background: var(--bg); }
.cal .day.today .num { background: var(--accent); color: var(--accent-ink); }
.cal .num { display: inline-grid; place-items: center; min-width: 24px; height: 24px; border-radius: 12px; font-size: .8rem; font-weight: 700; margin-bottom: 4px; padding: 0 6px; }
.chip { display: block; padding: 4px 6px; margin-bottom: 4px; border-radius: 6px; background: var(--accent-soft); font-size: .75rem; line-height: 1.25; text-decoration: none; color: var(--ink); overflow: hidden; }
.chip b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chip .dots { display: flex; gap: 3px; margin-top: 2px; }

/* publiczne */
.hero { padding: 56px 0 24px; max-width: 760px; }
.hero h1 { font-size: 2.4rem; letter-spacing: -.03em; }
.legal { max-width: 760px; }
.legal h2 { margin-top: 28px; }
.legal li { margin-bottom: 6px; }
.foot { border-top: 1px solid var(--line); padding: 24px 0; color: var(--muted); font-size: .875rem; }
.foot a { color: var(--muted); margin-right: 16px; }
.authbox { max-width: 420px; margin: 48px auto; }
code, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .85em; }
.copy { background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; word-break: break-all; display: block; }

@media (max-width: 720px) {
  main { padding-top: 16px; }
  .top .wrap { gap: 4px 12px; }
  .nav { order: 3; flex: 1 0 100%; flex-wrap: nowrap; overflow-x: auto; margin: 0 -4px; padding-bottom: 4px; scrollbar-width: none; }
  .nav::-webkit-scrollbar { display: none; }
  .nav a { white-space: nowrap; padding: 8px 10px; }
  .who { margin-left: auto; }
  .grid.two, .grid.three, .preview { grid-template-columns: 1fr; }
  h1 { font-size: 1.35rem; }
  .hero h1 { font-size: 1.8rem; }
  .cal .day { min-height: 64px; padding: 3px; }
  .cal.week { grid-template-columns: 1fr; }
  .cal.week .dow { display: none; }
  .cal.week .day { min-height: 0; }
  .chip { font-size: .68rem; padding: 2px 4px; }
  .who span { display: none; }
  .card { padding: 16px; }
}

.auto { width: auto; }
.grow { flex: 1; min-width: 220px; }
.pre { white-space: pre-wrap; word-break: break-word; }

/* podgląd 4 kanałów */
.pv { background: var(--surface); }
.pv:fullscreen { background: #0b0b0f; padding: 16px; overflow: auto; color: #eef0f6; }
.pv-bar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.pv-bar input[type=range] { flex: 1; min-width: 140px; accent-color: var(--accent); }
.pv-bar .check { margin: 0; }
.pv-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.pv:fullscreen .pv-grid { height: calc(100vh - 90px); grid-template-columns: repeat(4, minmax(0, calc((100vh - 130px) * 9 / 16))); justify-content: center; }
.pv-cell { min-width: 0; }
.pv-cell.dim { opacity: .45; }
.pv-label { display: flex; align-items: center; gap: 6px; font-weight: 700; font-size: .85rem; margin-bottom: 6px; flex-wrap: wrap; }
.pv-screen { position: relative; width: 100%; aspect-ratio: 9 / 16; background: #000; border-radius: 14px; overflow: hidden; }
.pv-screen video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.pv-layer { position: absolute; left: 0; top: 0; width: 1080px; height: 1920px; transform-origin: 0 0; pointer-events: none; }
.no-ov .ov { display: none; }
.safe { display: none; }
.show-safe .safe { display: block; }
.ov, .safe { position: absolute; inset: 0; }
.ov { color: #fff; font: 500 40px/1.3 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; text-shadow: 0 1px 6px rgba(0, 0, 0, .55); }
.ov > * { position: absolute; }
.ov svg { width: 100%; height: 100%; display: block; filter: drop-shadow(0 1px 4px rgba(0, 0, 0, .5)); }
.ov-ic { display: block; }
.ov-title { font-size: 54px; font-weight: 800; }
.ov-tabs { display: flex; justify-content: center; gap: 44px; font-size: 44px; font-weight: 600; color: rgba(255, 255, 255, .7); }
.ov-tabs .on { color: #fff; border-bottom: 5px solid #fff; padding-bottom: 6px; }
.ov-act { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.ov-count { font-size: 30px; font-weight: 600; white-space: nowrap; }
.ov-avatar { display: inline-block; width: 64px; height: 64px; border-radius: 50%; background: linear-gradient(135deg, #8b80ff, #ff7aa8); border: 3px solid #fff; flex: none; position: relative; }
.ov-avatar.big { width: 96px; height: 96px; }
.ov-avatar i { position: absolute; left: 50%; bottom: -22px; transform: translateX(-50%); width: 40px; height: 40px; border-radius: 50%; background: #fe2c55; color: #fff; font: 700 34px/40px system-ui; text-align: center; font-style: normal; }
.ov-disc { display: block; width: 88px; height: 88px; border-radius: 50%; background: radial-gradient(circle, #555 0 22%, #111 23% 100%); border: 12px solid #222; }
.ov-audio { display: block; width: 72px; height: 72px; border-radius: 14px; background: linear-gradient(135deg, #444, #999); border: 3px solid #fff; }
.ov-bottom { display: flex; flex-direction: column; gap: 14px; }
.ov-user { display: flex; align-items: center; gap: 18px; font-size: 42px; }
.ov-user strong { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 520px; }
.ov-follow { border: 2px solid rgba(255, 255, 255, .85); border-radius: 14px; padding: 4px 22px; font-size: 34px; font-weight: 600; white-space: nowrap; }
.ov-caption { font-size: 38px; line-height: 1.35; max-height: 3.1em; overflow: hidden; }
.ov-caption b { font-weight: 700; }
.ov-more { color: rgba(255, 255, 255, .75); font-weight: 600; }
.ov-titleline { font-size: 42px; font-weight: 600; line-height: 1.3; }
.ov-audioline { display: flex; align-items: center; gap: 12px; font-size: 34px; white-space: nowrap; overflow: hidden; }
.ov-audioline svg { width: 36px; height: 36px; flex: none; }
.ov-progress { background: rgba(255, 255, 255, .3); }
.ov-progress i { display: block; height: 100%; width: 0; background: #fff; }
.ov-nav { display: flex; justify-content: space-around; align-items: center; background: #000; }
.ov-nav span { width: 66px; height: 66px; display: block; }
.ov-nav span.plus { width: 96px; height: 66px; }
.safe-blk { position: absolute; background: rgba(255, 40, 60, .38); }
.safe-blk.col { background: rgba(255, 170, 0, .42); }
.safe-line { position: absolute; border: 4px dashed rgba(255, 255, 255, .9); }
@media (max-width: 1100px) { .pv-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 720px) { .pv-grid { gap: 10px; } .pv-label { font-size: .75rem; } }
