@font-face { font-family: "Cormorant Garamond"; font-weight: 600; font-display: block; src: url(/player/fonts/cormorant-garamond-latin-600-normal.woff2) format("woff2"); }
@font-face { font-family: "Cormorant Garamond"; font-weight: 700; font-display: block; src: url(/player/fonts/cormorant-garamond-latin-700-normal.woff2) format("woff2"); }
@font-face { font-family: "Arimo"; font-weight: 400; src: url(/player/fonts/arimo-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: "Arimo"; font-weight: 600; src: url(/player/fonts/arimo-latin-600-normal.woff2) format("woff2"); }
@font-face { font-family: "Arimo"; font-weight: 700; src: url(/player/fonts/arimo-latin-700-normal.woff2) format("woff2"); }
:root {
  --bg: #f4f5f7; --panel: #fff; --ink: #1a1d23; --muted: #6b7280; --line: #e3e5e9;
  --accent: #FFA300; --accent-ink: #000; --accent-text: #9a6200; --ok: #15803d; --warn: #b45309; --bad: #b91c1c;
  --radius: 10px; --shadow: 0 1px 2px rgba(0,0,0,.05), 0 2px 8px rgba(0,0,0,.04);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 14px/1.45 Arial, Arimo, "Helvetica Neue", sans-serif; }
.hidden { display: none !important; }
h1 { font-size: 20px; margin: 8px 0 16px; }
h2 { font-size: 17px; margin: 0; }
code { background: #eef0f4; padding: 3px 6px; border-radius: 5px; font-size: 13px; word-break: break-all; }
.muted { color: var(--muted); }
input, select { font: inherit; padding: 7px 9px; border: 1px solid var(--line); border-radius: 7px; background: #fff; color: var(--ink); min-width: 0; }
input:focus, select:focus { outline: 2px solid color-mix(in srgb, var(--accent) 35%, transparent); border-color: var(--accent); }

.btn { display: inline-flex; align-items: center; gap: 6px; font: inherit; font-weight: 500; padding: 7px 13px; border-radius: 7px;
  border: 1px solid var(--line); background: #fff; color: var(--ink); cursor: pointer; white-space: nowrap; }
.btn:hover { background: #f7f8fa; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.07); }
.btn.danger { color: var(--bad); }
.btn.small { padding: 4px 9px; font-size: 13px; }
.btn.icon { padding: 4px 8px; }
.btn:disabled { opacity: .5; cursor: default; }

/* login */
.login { min-height: 100vh; display: grid; place-items: center; }
.login-card { background: var(--panel); padding: 32px; border-radius: 14px; box-shadow: var(--shadow); width: 320px; display: grid; gap: 12px; text-align: center; }
.error { color: var(--bad); min-height: 1em; }
.brand-mark { color: var(--accent); font-size: 18px; }

/* header */
.top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 24px; padding: 0 24px; height: 56px; background: var(--panel); border-bottom: 1px solid var(--line); }
.brand { font-weight: 650; display: flex; gap: 8px; align-items: center; }
.tabs { display: flex; gap: 4px; height: 100%; }
.tabs button { font: inherit; background: none; border: 0; padding: 0 12px; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; }
.tabs button.active { color: var(--ink); border-bottom-color: var(--accent); font-weight: 550; }
main { max-width: 1180px; margin: 0 auto; padding: 24px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin: 12px 0 28px; box-shadow: var(--shadow); }
.form { display: grid; gap: 14px; max-width: 460px; }
.form label, .field { display: grid; gap: 5px; font-weight: 500; font-size: 13px; }
.note { background: #fff7e6; border: 1px solid #f4d9a6; color: #7a4b00; padding: 10px 14px; border-radius: 8px; margin-bottom: 16px; }
.empty { color: var(--muted); padding: 40px; text-align: center; }

/* screens */
.cards { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; display: grid; gap: 12px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.card-title { font-weight: 650; font-size: 15px; display: flex; align-items: center; gap: 8px; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: #c4c8cf; flex: none; }
.dot.on { background: #22c55e; box-shadow: 0 0 0 3px #22c55e22; }
.dot.stale { background: #f59e0b; }
.status-line { color: var(--muted); font-size: 12.5px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; }
.row .field { flex: 1 1 140px; }
.check { display: flex; gap: 6px; align-items: center; font-size: 13px; font-weight: 500; }
.sched { border-top: 1px solid var(--line); padding-top: 10px; }
.sched-head { display: flex; justify-content: space-between; align-items: center; font-weight: 600; font-size: 13px; margin-bottom: 6px; }
.sched-item { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 7px 10px; border-radius: 7px; background: #f7f8fa; margin-top: 6px; font-size: 13px; }
.sched-item .when { color: var(--muted); font-size: 12px; }
.sched-item.live { background: #ecfdf3; outline: 1px solid #bbf0cf; }
.pill { display: inline-block; font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 99px; background: #FFF8E8; color: #7a4b00; }
.pill.live { background: #dcfce7; color: #166534; }

/* playlists */
.split { display: grid; grid-template-columns: 260px 1fr; gap: 20px; align-items: start; }
.side { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow); position: sticky; top: 76px; }
.side .section-head { margin-bottom: 8px; }
.side-list { list-style: none; margin: 0; padding: 0; }
.side-list li { padding: 8px 10px; border-radius: 7px; cursor: pointer; display: flex; justify-content: space-between; gap: 6px; }
.side-list li:hover { background: #f3f4f7; }
.side-list li.active { background: #FFF8E8; color: var(--accent-text); font-weight: 600; }
.side-list .count { color: var(--muted); font-weight: 400; font-size: 12px; }
.main-pane { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); min-height: 300px; }
.pl-head { display: flex; gap: 10px; align-items: center; margin-bottom: 6px; }
.pl-head input { font-size: 17px; font-weight: 600; flex: 1; border-color: transparent; padding-left: 4px; }
.pl-head input:hover { border-color: var(--line); }
.pl-meta { color: var(--muted); font-size: 13px; margin: 0 0 14px 4px; }
.items { list-style: none; padding: 0; margin: 0 0 14px; display: grid; gap: 6px; }
.item { display: grid; grid-template-columns: 22px 96px 1fr auto; gap: 12px; align-items: center; padding: 8px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.item.dragging { opacity: .4; }
.item.over { border-color: var(--accent); box-shadow: 0 -2px 0 var(--accent); }
.handle { cursor: grab; color: #9aa1ad; text-align: center; user-select: none; }
.thumb { width: 96px; height: 54px; border-radius: 5px; background: #111; object-fit: cover; display: block; }
.item-name { font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item-sub { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 5px; font-size: 12.5px; color: var(--muted); }
.item-sub input { padding: 3px 6px; font-size: 12.5px; }
.item-sub input[type=number] { width: 70px; }
.item-sub .br { flex-basis: 100%; height: 0; }
.item-actions { display: flex; gap: 4px; }
.expired { opacity: .55; }
.footer-bar { display: flex; gap: 8px; justify-content: space-between; align-items: center; border-top: 1px solid var(--line); padding-top: 14px; }
.dirty-note { color: var(--warn); font-size: 13px; font-weight: 500; }

/* media */
.drop { border: 2px dashed #c8ccd4; border-radius: var(--radius); padding: 22px; text-align: center; color: var(--muted); margin-bottom: 16px; background: #fafbfc; }
.drop.over { border-color: var(--accent); background: #FFF8E8; color: var(--accent-text); }
.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.tile { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); position: relative; }
.tile .thumb { width: 100%; height: auto; aspect-ratio: 16/9; border-radius: 0; }
.tile-body { padding: 9px 10px; }
.tile-name { font-weight: 550; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile-meta { color: var(--muted); font-size: 12px; margin-top: 2px; display: flex; justify-content: space-between; }
.tile-actions { position: absolute; top: 6px; right: 6px; display: flex; gap: 4px; opacity: 0; transition: opacity .15s; }
.tile:hover .tile-actions { opacity: 1; }
.tile-actions .btn { background: rgba(255,255,255,.95); }
.badge { position: absolute; top: 6px; left: 6px; background: rgba(0,0,0,.65); color: #fff; font-size: 11px; padding: 2px 7px; border-radius: 99px; }
.tile.pick { cursor: pointer; }
.tile.pick.selected { outline: 3px solid var(--accent); }
.upload-row { display: flex; gap: 10px; align-items: center; font-size: 13px; margin-bottom: 8px; }
.upload-row .bar { flex: 1; height: 6px; background: #e5e7eb; border-radius: 9px; overflow: hidden; }
.upload-row .bar div { height: 100%; background: var(--accent); width: 0; transition: width .2s; }
.upload-row .name { width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* modal + toast */
.modal { position: fixed; inset: 0; background: rgba(15,18,25,.45); display: grid; place-items: center; z-index: 20; padding: 20px; }
.modal-card { background: var(--panel); border-radius: 14px; padding: 22px; width: min(520px, 100%); max-height: 90vh; overflow: auto; box-shadow: 0 20px 60px rgba(0,0,0,.25); display: grid; gap: 14px; }
.modal-card.wide { width: min(980px, 100%); }
.modal-card h3 { margin: 0; font-size: 17px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; }
.days { display: flex; gap: 4px; flex-wrap: wrap; }
.days label { display: inline-flex; }
.days input { display: none; }
.days span { padding: 5px 10px; border: 1px solid var(--line); border-radius: 7px; cursor: pointer; font-size: 13px; font-weight: 500; }
.days input:checked + span { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.code-input { font: 600 26px ui-monospace, Menlo, Consolas, monospace; letter-spacing: 6px; text-transform: uppercase; text-align: center; }
.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); background: #1f2430; color: #fff; padding: 10px 16px; border-radius: 9px; z-index: 30; box-shadow: 0 8px 24px rgba(0,0,0,.2); }
.toast.bad { background: var(--bad); }

@media (max-width: 760px) {
  .top { gap: 10px; padding: 0 12px; overflow-x: auto; }
  main { padding: 14px; }
  .split { grid-template-columns: 1fr; }
  .side { position: static; }
  .cards { grid-template-columns: 1fr; }
  .item { grid-template-columns: 18px 72px 1fr; }
  .item-actions { grid-column: 1 / -1; justify-content: flex-end; }
  .thumb { width: 72px; height: 40px; }
}

.brand-logo { height: 34px; width: auto; max-width: 160px; background: var(--brand-bg, #111111); padding: 3px; border-radius: 6px; box-sizing: border-box; }
.logo-row { display: flex; gap: 20px; align-items: flex-start; flex-wrap: wrap; }
.logo-preview { min-width: 120px; min-height: 68px; padding: 8px; display: inline-flex; align-items: center; justify-content: center; border-radius: 8px; border: 1px solid var(--line); background: var(--brand-bg, radial-gradient(circle at 50% 30%, #2a2a2a, #000000 75%));
  display: grid; place-items: center; flex: none; }
.logo-preview img { display: block; max-width: 280px; max-height: 160px; width: auto; height: auto; border-radius: 3px; }
.logo-preview .muted { color: #8b93a3; }
.bg-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-weight: 500; font-size: 13px; margin-bottom: 4px; }
.bg-row input[type=color] { width: 44px; height: 32px; padding: 2px; cursor: pointer; }
.logo-preview.photo { width: 288px; height: 162px; padding: 0; background-size: cover; background-position: center; position: relative; overflow: hidden; }
.logo-preview.photo::after { content: ""; position: absolute; inset: 0; background: linear-gradient(rgba(0,0,0,.25), rgba(0,0,0,.55)); }
.logo-preview.photo img { display: none; }
.brand-logo.photo { padding: 0; width: 52px; height: 34px; object-fit: cover; }
/* "None" background: logo shown as-is, no dark badge or backdrop */
body.no-logo-bg .brand-logo { background: none; padding: 0; }
body.no-logo-bg .logo-preview:not(.photo) { padding: 0; border: 0; }
body.no-logo-bg .logo-preview:not(.photo) { background: repeating-conic-gradient(#f1f2f5 0 25%, #fff 0 50%) 0 0 / 16px 16px; }
.yt-thumb { display: grid; place-items: center; background: linear-gradient(135deg, #2a0d0d, #111); }
.yt-thumb span { color: #fff; background: #d42020; font: 700 11px/1 system-ui; letter-spacing: 1px; padding: 4px 7px; border-radius: 4px; }
.tile .yt-thumb { aspect-ratio: 16/9; height: auto; }
.cd-thumb { display: flex !important; flex-direction: column; align-items: center; justify-content: center; gap: 2px; text-align: center; }
.cd-thumb small { font-size: 9px; opacity: .85; max-width: 90%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.cd-thumb b { font-size: 18px; font-weight: 400; font-variant-numeric: tabular-nums; }
.tile .cd-thumb { aspect-ratio: 16/9; height: auto; }
.tile .cd-thumb small { font-size: 12px; } .tile .cd-thumb b { font-size: 34px; }
.cd-preview { aspect-ratio: 16/9; border-radius: 10px; display: flex; flex-direction: column; align-items: center; justify-content: center; border: 1px solid var(--line); }
.cd-preview .t { font-size: 18px; font-weight: 600; } .cd-preview .n { font-size: 64px; font-weight: 300; line-height: 1; font-variant-numeric: tabular-nums; }
.tile-end { font-size: 12px; color: var(--warn); font-weight: 500; margin-top: 2px; }
.tile-end.past { color: var(--bad); }
.modal-thumb { width: 100%; height: auto; max-height: 220px; aspect-ratio: 16/9; object-fit: contain; border-radius: 8px; }
.now-showing { display: grid; grid-template-columns: 128px 1fr; gap: 12px; align-items: center; background: #f7f8fa; border-radius: 8px; padding: 8px; }
.now-showing .thumb { width: 128px; height: 72px; }
.now-showing.stale { opacity: .6; }
.ns-label { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; }
.ns-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ns-idle { display: grid; place-items: center; font-size: 24px; background: #2a2a2a !important; }
.preview-frame { aspect-ratio: 16/9; background: #000; border-radius: 8px; overflow: hidden; }
.preview-frame.portrait { aspect-ratio: 9/16; max-height: 65vh; margin: 0 auto; }
.preview-frame iframe { width: 100%; height: 100%; border: 0; display: block; }
a.btn { text-decoration: none; }
.cal-thumb { display: flex !important; flex-direction: column; justify-content: center; gap: 4px; padding: 6px 10px; box-sizing: border-box; }
.cal-thumb b { font-size: 10px; } .cal-thumb i { display: block; height: 3px; border-radius: 2px; background: currentColor; opacity: .45; width: 80%; }
.cal-thumb i:nth-child(3) { width: 60%; } .cal-thumb i:nth-child(4) { width: 70%; }
.tile .cal-thumb { aspect-ratio: 16/9; height: auto; padding: 14px 18px; gap: 8px; } .tile .cal-thumb b { font-size: 15px; } .tile .cal-thumb i { height: 5px; }
.qr-row { display: flex; gap: 22px; align-items: flex-start; flex-wrap: wrap; }
.qr { width: 168px; height: 168px; flex: none; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 6px; }
.qr svg { width: 100%; height: 100%; display: block; }
.color-row .field { flex: 0 0 auto; } .color-row input[type=color] { width: 56px; height: 34px; padding: 2px; }
.cal-preview { border: 1px solid var(--line); border-radius: 8px; font-family: Arimo, Arial, sans-serif; flex-shrink: 0; }
.cp-band { border-radius: 7px 7px 0 0; }
.cp-band { color: #fff; padding: 10px 16px; font-size: 18px; }
.cp-title { padding: 12px 16px 2px; font-size: 18px; font-weight: 700; }
.cp-body { padding: 6px 16px 10px; }
.cp-day { display: grid; grid-template-columns: 44px 76px 1fr; gap: 8px; font-size: 12.5px; padding: 5px 0; border-top: 1px solid rgba(127,127,127,.35); }
.cp-day b { letter-spacing: .06em; } .cp-day span:last-child { font-weight: 600; }
.cal-thumb.banner { padding: 0 !important; justify-content: flex-start; }
.cal-thumb.banner b { display: block; width: 100%; padding: 6px 10px; box-sizing: border-box; font-weight: 400; }
.cal-thumb.banner i { margin-left: 10px; }
body.role-editor .admin-only { display: none !important; }
.user-chip { margin-left: auto; display: flex; align-items: center; gap: 10px; font-size: 13px; white-space: nowrap; }
.user-chip .who { color: var(--muted); max-width: 220px; overflow: hidden; text-overflow: ellipsis; display: inline-block; vertical-align: middle; }
.user-chip .pill { margin-left: 6px; }
.invite-row { display: flex; gap: 8px; flex-wrap: wrap; } .invite-row input { flex: 1 1 240px; }
.invite-msg { margin-top: 14px; background: #FFF8E8; border: 1px solid #f4d9a6; border-radius: 8px; padding: 12px; display: grid; gap: 8px; }
.invite-msg textarea { width: 100%; font: inherit; font-size: 13px; padding: 8px; border: 1px solid var(--line); border-radius: 6px; resize: vertical; }
table.users { width: 100%; border-collapse: collapse; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
table.users th, table.users td { text-align: left; padding: 10px 14px; border-top: 1px solid var(--line); vertical-align: middle; }
table.users th { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); border-top: 0; background: #fafbfc; }
.act { padding: 6px 0; border-top: 1px solid var(--line); font-size: 13.5px; } .act:first-child { border-top: 0; }
@media (max-width: 760px) { .user-chip .who { display: none; } }
.modal-card.xwide { width: min(1240px, 100%); }
.designer { display: grid; grid-template-columns: minmax(320px, 420px) 1fr; gap: 22px; align-items: start; }
.dz-form { display: grid; gap: 12px; }
.dz-form textarea { font: inherit; padding: 7px 9px; border: 1px solid var(--line); border-radius: 7px; resize: vertical; }
.dz-preview { position: sticky; top: 0; }
.dz-frame { width: 100%; aspect-ratio: 16/9; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); background: #eee; position: relative; }
.tpl-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-top: 4px; }
.tpl { border: 2px solid var(--line); border-radius: 8px; background: #fff; padding: 4px; cursor: pointer; font: inherit; font-size: 11.5px; font-weight: 500; display: grid; gap: 4px; color: var(--ink); }
.tpl.on { border-color: var(--accent); box-shadow: 0 0 0 2px #FFA30055; }
.tpl-thumb { width: 100%; aspect-ratio: 16/9; border-radius: 4px; position: relative; overflow: hidden; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; margin-top: 4px; width: max-content; }
.seg button { font: inherit; font-size: 13px; padding: 6px 14px; border: 0; background: #fff; cursor: pointer; border-left: 1px solid var(--line); }
.seg button:first-child { border-left: 0; }
.seg button.on { background: var(--accent); color: var(--accent-ink); }
.slide-thumb { position: relative; overflow: hidden; background: #ddd; }
.tile .slide-thumb { width: 100%; aspect-ratio: 16/9; height: auto; }
@media (max-width: 900px) { .designer { grid-template-columns: 1fr; } .dz-preview { position: static; order: -1; } }
.fmt-bar { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 4px; }
.fmt-bar .seg { margin-top: 0; }
.seg svg { width: 16px; height: 16px; stroke: currentColor; stroke-width: 1.6; fill: none; stroke-linecap: round; display: block; }
.lbl-row { display: flex; justify-content: space-between; align-items: center; }
.size-ctl { font-weight: 400; font-size: 12px; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.size-ctl input { width: 110px; padding: 0; }
.fmt-btns { display: flex; gap: 4px; margin: 2px 0 2px; }
.fmt-btns button { font: inherit; font-size: 13px; width: 30px; height: 26px; border: 1px solid var(--line); border-radius: 6px; background: #fff; cursor: pointer; color: var(--ink); }
.fmt-btns button:hover { background: #f1f3f7; }
.fmt-accent { color: #B37200 !important; font-weight: 700 !important; text-decoration: underline; text-decoration-color: #FFA300; }
