:root { --bg: #f4f6f5; --card: #fff; --fg: #17201c; --muted: #66736d; --line: #dfe5e2; --brand: #145c45; --brand2: #0b3d2e;
  --danger: #b3261e; --ok: #1f8a4c; }
@media (prefers-color-scheme: dark) {
  :root { --bg: #0f1412; --card: #171e1b; --fg: #e6ece9; --muted: #93a19a; --line: #2a3430; --brand: #2f9a74; --brand2: #1f7558; }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 15px/1.45 "Segoe UI", Roboto, Arial, sans-serif; }
h1, h2, h3 { margin: 0 0 12px; } h2 { font-size: 17px; } h3 { font-size: 15px; margin-top: 20px; }
code { background: var(--bg); padding: 1px 6px; border-radius: 4px; }
input, select, textarea, button { font: inherit; color: inherit; }
input, select, textarea { background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; }
textarea { width: 100%; resize: vertical; }
label { display: block; color: var(--muted); font-size: 13px; }
label > input, label > select, label > textarea { display: block; margin-top: 4px; color: var(--fg); }
label.chk { display: flex; align-items: center; gap: 6px; color: var(--fg); font-size: 15px; }
button { background: var(--brand); color: #fff; border: 0; border-radius: 8px; padding: 8px 14px; cursor: pointer; }
button:hover { background: var(--brand2); }
button.ghost { background: transparent; color: var(--fg); border: 1px solid var(--line); }
button.ghost:hover { background: var(--bg); }
button.danger { color: var(--danger); }
button.sm { padding: 3px 9px; font-size: 13px; }
.err { color: var(--danger); min-height: 1em; margin: 8px 0 0; }
.hint { color: var(--muted); font-size: 13px; }

header { display: flex; align-items: center; gap: 24px; padding: 10px 20px; background: var(--card); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 3; }
header nav { display: flex; gap: 4px; flex: 1; }
header nav button { background: transparent; color: var(--muted); }
header nav button.active { background: var(--bg); color: var(--fg); }
main { max-width: 1200px; margin: 0 auto; padding: 20px 16px 60px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 18px; margin-bottom: 16px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
.row.between { justify-content: space-between; }
.split { display: flex; gap: 16px; align-items: flex-start; }
.side { width: 260px; flex: none; } .grow { flex: 1; min-width: 0; }
@media (max-width: 800px) { .split { flex-direction: column; } .side { width: 100%; } header { gap: 10px; flex-wrap: wrap; } }

.login { min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.login .card { width: 320px; } .login input { width: 100%; } .login button { margin-top: 14px; width: 100%; }

table.list { width: 100%; border-collapse: collapse; }
table.list th { text-align: left; color: var(--muted); font-weight: 500; font-size: 13px; }
table.list td, table.list th { padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.list td:last-child { text-align: right; white-space: nowrap; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; background: #9aa5a0; }
.dot.on { background: var(--ok); box-shadow: 0 0 0 3px rgba(31,138,76,.2); }

ul.pick { list-style: none; padding: 0; margin: 0 0 12px; }
ul.pick li { padding: 8px 10px; border-radius: 8px; cursor: pointer; }
ul.pick li:hover { background: var(--bg); } ul.pick li.sel { background: var(--brand); color: #fff; }
.title-input { font-size: 18px; font-weight: 600; flex: 1; min-width: 200px; }

.item { display: flex; gap: 12px; align-items: flex-start; border: 1px solid var(--line); border-radius: 10px; padding: 10px; margin-bottom: 8px; }
.item .thumb { width: 96px; height: 54px; border-radius: 6px; background: #000 center/cover; flex: none; display: flex;
  align-items: center; justify-content: center; color: #fff; font-size: 12px; overflow: hidden; }
.item .thumb video { width: 100%; height: 100%; object-fit: cover; }
.item .body { flex: 1; min-width: 0; }
.item .body .row { margin-bottom: 6px; }
.item .body input[type=text], .item .body textarea { width: 100%; }
.item .ctrl { display: flex; flex-direction: column; gap: 4px; }
.item .days { display: flex; gap: 2px; }
.item .days label { display: flex; align-items: center; gap: 2px; font-size: 12px; }
.item details summary { cursor: pointer; color: var(--muted); font-size: 13px; }
.num { width: 80px; }
.add { margin-top: 10px; }

details.news { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin: 12px 0 4px; }
details.news summary { cursor: pointer; font-weight: 600; }
details.news textarea { margin-bottom: 8px; }
.presets { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 4px 12px; margin: 8px 0 10px; }
.news-status { list-style: none; padding: 0; margin: 6px 0 0; font-size: 13px; }
.news-status li { padding: 3px 0; border-top: 1px dashed var(--line); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.news-status .ok { color: var(--ok); } .news-status .bad { color: var(--danger); }

.preview { position: relative; width: 100%; max-width: 720px; aspect-ratio: 16/9; background: #000; border-radius: 10px; overflow: hidden; }
.preview iframe { position: absolute; left: 0; top: 0; width: 1920px; height: 1080px; border: 0; transform-origin: 0 0; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.tile { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.tile .thumb { aspect-ratio: 16/9; background: #000 center/contain no-repeat; }
.tile .thumb video { width: 100%; height: 100%; object-fit: contain; }
.tile .meta { padding: 8px; font-size: 13px; display: flex; justify-content: space-between; gap: 6px; align-items: center; }
.tile .meta span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
