:root {
  --bg: #0b0e14;
  --panel: #131824;
  --panel2: #1a2130;
  --line: #263149;
  --text: #e6ebf5;
  --muted: #8a97b0;
  --accent: #3d7bff;
  --accent2: #6ea8ff;
  --green: #3ad07a;
  --red: #f0574a;
  --radius: 12px;
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 14px;
}
a { color: var(--accent2); }
h2 { font-size: 18px; margin: 0; }
.muted { color: var(--muted); font-size: 13px; margin: 4px 0 0; }
code { background: #0006; padding: 1px 5px; border-radius: 4px; }

.topbar {
  display: flex; align-items: center; gap: 24px;
  padding: 12px 20px; background: var(--panel); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 10;
}
.brand { display: flex; align-items: center; gap: 9px; font-weight: 700; font-size: 18px; letter-spacing: -0.01em; }
.brand .mark { width: 26px; height: 26px; flex: 0 0 auto; }
.brand .b-easy { font-weight: 500; opacity: 0.82; }
.tabs { display: flex; gap: 4px; }
.tab {
  background: transparent; border: 0; color: var(--muted);
  padding: 8px 14px; border-radius: 8px; cursor: pointer; font-size: 14px;
}
.tab:hover { color: var(--text); background: var(--panel2); }
.tab.active { color: #fff; background: var(--accent); }
.launch-link { margin-left: auto; color: var(--accent2); text-decoration: none; font-size: 13px; padding: 6px 12px; border: 1px solid var(--line); border-radius: 8px; }
.launch-link:hover { border-color: var(--accent); }
.lic-pill { font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel2); color: var(--muted); white-space: nowrap; }
.lic-pill:hover { border-color: var(--accent); color: var(--text); }
.lic-pill.trial { color: #ffd479; border-color: #5a4a12; background: #2a2410; }
.lic-pill.licensed { color: var(--green); border-color: #1e5b3a; background: #10231a; }
.lic-pill.expired { color: #ff9a8f; border-color: #6b2b22; background: #2a1512; }
.trial-banner { display: flex; align-items: center; gap: 16px; justify-content: center; flex-wrap: wrap; padding: 10px 20px; background: #2a1512; border-bottom: 1px solid #6b2b22; color: #ffcfc7; font-size: 14px; }
.trial-banner .tb-actions { display: flex; gap: 8px; }
.conn { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--red); }
.dot.online { background: var(--green); box-shadow: 0 0 7px var(--green); }

main { padding: 22px; max-width: 1200px; margin: 0 auto; }
.panel { display: none; }
.panel.active { display: block; }
.panel-head { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; flex-wrap: wrap; }
.panel-head h2 { margin-right: auto; }

/* toggle switch */
.toggle { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13px; color: var(--muted); user-select: none; }
.toggle input { display: none; }
.toggle .track { width: 38px; height: 22px; border-radius: 999px; background: var(--panel2); border: 1px solid var(--line); position: relative; transition: background .2s; }
.toggle .knob { position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--muted); transition: transform .2s, background .2s; }
.toggle input:checked + .track { background: var(--accent); border-color: var(--accent); }
.toggle input:checked + .track .knob { transform: translateX(16px); background: #fff; }
.toggle input:checked ~ span:last-child { color: var(--text); }

/* live preview thumbnail on a screen card */
.card .preview { aspect-ratio: 16 / 9; background: #000; border-radius: 8px; overflow: hidden; display: flex; align-items: center; justify-content: center; position: relative; border: 1px solid var(--line); }
.card .preview img { width: 100%; height: 100%; object-fit: contain; display: none; }
.card .preview img.has { display: block; }
.card .preview .ph { color: var(--muted); font-size: 12px; }
.card .preview .live { position: absolute; top: 6px; left: 6px; font-size: 10px; letter-spacing: .5px; background: #0008; color: #ff6b6b; padding: 1px 6px; border-radius: 4px; display: flex; align-items: center; gap: 4px; }
.card .preview .live::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: #ff4a4a; }

.btn {
  background: var(--panel2); color: var(--text); border: 1px solid var(--line);
  padding: 8px 14px; border-radius: 8px; cursor: pointer; font-size: 13px;
}
.btn:hover { border-color: var(--accent); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.danger { color: var(--red); }
.btn.small { padding: 4px 9px; font-size: 12px; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.grid.media { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }

.empty { color: var(--muted); padding: 30px; text-align: center; border: 1px dashed var(--line); border-radius: var(--radius); }
.hidden { display: none !important; }

/* ---- screen cards ---- */
.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px; display: flex; flex-direction: column; gap: 10px;
}
.card .row { display: flex; align-items: center; gap: 8px; }
.card .title { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.card .name-input {
  background: transparent; border: 0; color: var(--text); font-weight: 600; font-size: 15px;
  border-bottom: 1px solid transparent; padding: 2px 0; width: 100%;
}
.card .name-input:focus { outline: none; border-bottom-color: var(--accent); }
.status { font-size: 11px; padding: 2px 8px; border-radius: 999px; background: #3a2020; color: #ff9a8f; }
.status.online { background: #10321f; color: #6ff0a6; }
.field { display: flex; flex-direction: column; gap: 4px; }
.field label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; }
select, input[type=number], input[type=text] {
  background: var(--panel2); border: 1px solid var(--line); color: var(--text);
  padding: 7px 8px; border-radius: 7px; font-size: 13px; width: 100%;
}
select:focus, input:focus { outline: none; border-color: var(--accent); }
.card .now { font-size: 12px; color: var(--accent2); }
.content-row { display: flex; gap: 6px; align-items: stretch; }
.content-row select { flex: 1; min-width: 0; }
.content-row .btn { white-space: nowrap; }
.gcells { display: grid; gap: 6px; margin-bottom: 6px; }
.gcell { display: flex; align-items: center; gap: 6px; }
.gcell .gidx { font-size: 11px; color: var(--muted); width: 16px; text-align: center; flex: 0 0 auto; }
.gcell select { flex: 1; min-width: 0; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 2px; }

/* ---- playlists ---- */
.split { display: grid; grid-template-columns: 240px 1fr; gap: 16px; align-items: start; }
.list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.list li {
  padding: 10px 12px; background: var(--panel); border: 1px solid var(--line);
  border-radius: 8px; cursor: pointer; display: flex; align-items: center; gap: 8px;
}
.list li.active { border-color: var(--accent); background: var(--panel2); }
.list li .count { margin-left: auto; color: var(--muted); font-size: 12px; }
.editor { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; min-height: 300px; }
.editor .ed-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.editor .ed-head input[type=text] { max-width: 260px; }
.item-row {
  display: flex; align-items: center; gap: 10px; padding: 8px;
  background: var(--panel2); border: 1px solid var(--line); border-radius: 8px; margin-bottom: 8px;
}
.item-row .thumb { width: 60px; height: 40px; border-radius: 5px; object-fit: cover; background: #000; flex: 0 0 auto; }
.item-row .thumb.ph { display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 18px; }
.item-row .meta { flex: 1; min-width: 0; }
.item-row .meta .n { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item-row .meta .t { font-size: 11px; color: var(--muted); }
.item-row .dur { width: 66px; }
.item-row .fit { width: 96px; }
.badge { font-size: 10px; padding: 1px 6px; border-radius: 4px; background: #2a3550; color: var(--accent2); text-transform: uppercase; }

/* ---- schedule blocks ---- */
.block-row { background: var(--panel2); border: 1px solid var(--line); border-radius: 8px; padding: 10px; margin-bottom: 10px; display: flex; flex-direction: column; gap: 8px; }
.block-row .brow { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.block-row .blabel { flex: 1; min-width: 120px; }
.block-row .days { display: flex; gap: 3px; }
.block-row .day { width: 26px; height: 26px; border-radius: 6px; border: 1px solid var(--line); background: var(--panel); color: var(--muted); cursor: pointer; font-size: 12px; }
.block-row .day.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.block-row .tlabel { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; }
.block-row .tlabel input[type=time] { width: auto; }
.block-row .bcontent { flex: 1; min-width: 160px; }

/* ---- media ---- */
.dropzone { border: 2px dashed var(--line); border-radius: var(--radius); padding: 24px; text-align: center; color: var(--muted); margin-bottom: 16px; }
.dropzone.drag { border-color: var(--accent); color: var(--text); background: var(--panel2); }
.progress { height: 6px; background: var(--panel2); border-radius: 6px; overflow: hidden; margin-bottom: 16px; }
.progress .bar { height: 100%; width: 0; background: var(--accent); transition: width .2s; }
.mcard { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; position: relative; }
.mcard .prev { width: 100%; aspect-ratio: 16/10; object-fit: cover; background: #000; display: block; }
.mcard .prev.ph { display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 30px; }
.mcard .cap { padding: 7px 9px; display: flex; align-items: center; gap: 6px; }
.mcard .cap .n { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; }
.mcard .del { position: absolute; top: 6px; right: 6px; background: #000a; border: 0; color: #fff; border-radius: 6px; padding: 3px 7px; cursor: pointer; font-size: 12px; }

/* ---- groups/walls ---- */
.cols2 { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.stack { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.box { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 12px; display: flex; flex-direction: column; gap: 8px; }

/* multi-select media picker (modal) */
.modal { position: fixed; inset: 0; background: #000a; display: flex; align-items: center; justify-content: center; z-index: 50; }
.modal .sheet { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; width: min(760px, 92vw); max-height: 82vh; display: flex; flex-direction: column; }
.modal .sheet header { padding: 14px 18px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 10px; }
.modal .sheet .body { padding: 16px; overflow: auto; }
.modal .sheet footer { padding: 12px 18px; border-top: 1px solid var(--line); display: flex; gap: 8px; justify-content: flex-end; }
.pickgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px,1fr)); gap: 10px; }
.pick { border: 2px solid var(--line); border-radius: 8px; overflow: hidden; cursor: pointer; position: relative; }
.pick.sel { border-color: var(--accent); }
.pick img, .pick .ph { width: 100%; aspect-ratio: 16/10; object-fit: cover; background: #000; display: block; }
.pick .ph { display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 24px; }
.pick .lbl { font-size: 11px; padding: 4px 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pick .chk { position: absolute; top: 5px; left: 5px; background: var(--accent); color: #fff; border-radius: 50%; width: 20px; height: 20px; display: none; align-items: center; justify-content: center; font-size: 12px; }
.pick.sel .chk { display: flex; }

.toast {
  position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%);
  background: var(--panel2); border: 1px solid var(--line); color: var(--text);
  padding: 10px 18px; border-radius: 999px; z-index: 60; box-shadow: 0 8px 30px #0008;
}
