/* DAN Admin.
 *
 * The brief was "a modern operating system, not signage software", so the
 * rules are: one accent, four status colours that never appear anywhere else,
 * and cards big enough to read across a desk. Dark because this is a wall of
 * status indicators and a white page full of coloured dots is a christmas
 * tree.
 */

:root {
  --bg: #0b0d10;
  --panel: #14171c;
  --panel-2: #1a1e25;
  --line: #262b33;
  --line-soft: #1e232a;
  --ink: #e9edf3;
  --ink-2: #9aa4b2;
  --ink-3: #626b78;
  --accent: #5b8cff;
  --accent-ink: #0b0d10;

  /* Status. These four are load-bearing: they are the only reason to use a
   * colour in this app, so nothing else may borrow them. */
  --online: #3ddc84;
  --syncing: #ffc53d;
  --offline: #5b626e;
  --error: #ff5d5d;

  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 10px 30px rgba(0, 0, 0, .45);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, system-ui, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
}

* { box-sizing: border-box; }

/* The login overlay and the app shell are toggled with the hidden attribute,
 * and both carry a display rule of their own — which beats the browser's
 * default [hidden] { display: none }. Without this the sign-in screen stays
 * on top of a perfectly good dashboard. */
[hidden] { display: none !important; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea { font: inherit; color: inherit; }

/* ---- Shell ------------------------------------------------------------- */

.top {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 18px;
  padding: 14px 22px;
  background: rgba(11, 13, 16, .86);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line-soft);
}

.wordmark {
  font-size: 20px; font-weight: 800; letter-spacing: .14em;
  display: flex; align-items: center; gap: 9px;
}
.wordmark .dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 14px var(--accent);
}
.wordmark small {
  font-size: 10px; font-weight: 600; letter-spacing: .18em;
  color: var(--ink-3); margin-left: 2px;
}

/* min-width:0 because a flex item will not shrink below its content by
 * default, and this row of tabs was quietly making the whole document wider
 * than the window — which is how the page ends up scrolled sideways with the
 * sidebar clipped off the left. */
.tabs { display: flex; gap: 4px; margin-left: 12px; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { flex: none; }
.tabs button {
  background: none; border: 0; cursor: pointer;
  color: var(--ink-2); font-size: 14px; font-weight: 600;
  padding: 8px 14px; border-radius: 99px;
}
.tabs button:hover { color: var(--ink); background: var(--panel); }
.tabs button.on { color: var(--accent-ink); background: var(--accent); }

.tally { margin-left: auto; display: flex; align-items: center; gap: 16px; font-size: 13px; color: var(--ink-2); min-width: 0; }
.tally b { color: var(--ink); font-weight: 700; }
.tally > * { white-space: nowrap; }

/* The first thing to give up when the bar gets tight is the decoration. */
@media (max-width: 960px) { .wordmark small { display: none; } }

@media (max-width: 720px) {
  .top { flex-wrap: wrap; row-gap: 10px; }
  .tabs { order: 3; width: 100%; margin-left: 0; overflow-x: auto; }
  .tally { font-size: 12px; gap: 10px; }
}

main { padding: 26px 22px 80px; max-width: 1340px; margin: 0 auto; }
/* Nothing in this app is meant to be reached by scrolling sideways. */
body { overflow-x: hidden; }

h2.section {
  font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
  color: var(--ink-3); margin: 34px 0 14px;
}
h2.section:first-child { margin-top: 0; }

/* ---- Buttons ----------------------------------------------------------- */

.btn {
  background: var(--panel-2); border: 1px solid var(--line); color: var(--ink);
  padding: 9px 15px; border-radius: var(--radius-sm); cursor: pointer;
  font-size: 14px; font-weight: 600;
}
.btn:hover { border-color: #39404b; background: #20252d; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn.ghost:hover { color: var(--ink); background: var(--panel); }
.btn.danger { color: var(--error); border-color: #3a262a; }
.btn.danger:hover { background: #2a1a1d; border-color: var(--error); }
.btn.small { padding: 6px 11px; font-size: 13px; }
.btn:disabled { opacity: .45; cursor: default; }

input[type=text], input[type=password], input[type=number], select, textarea {
  background: var(--panel-2); border: 1px solid var(--line); color: var(--ink);
  border-radius: var(--radius-sm); padding: 10px 12px; font-size: 14px; width: 100%;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }
label.field { display: block; margin-bottom: 12px; }
label.field span {
  display: block; font-size: 11px; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; color: var(--ink-3); margin-bottom: 6px;
}

/* ---- Screen cards ------------------------------------------------------ */

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 16px; }

.card {
  background: var(--panel); border: 1px solid var(--line-soft);
  border-radius: var(--radius); padding: 18px; position: relative; overflow: hidden;
}
/* The status is the first thing you see from across the room: a bar down the
 * left edge in the state colour, not a small dot you have to go looking for. */
.card::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
  background: var(--offline);
}
.card.state-online::before { background: var(--online); }
.card.state-syncing::before { background: var(--syncing); }
.card.state-error::before { background: var(--error); }
.card.state-unpaired::before { background: var(--accent); }

.card h3 { margin: 0 0 3px; font-size: 17px; font-weight: 700; letter-spacing: -.01em; }
.card .where { color: var(--ink-3); font-size: 13px; margin-bottom: 14px; }

.state {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 12px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase;
  margin-bottom: 14px;
}
.state i { width: 9px; height: 9px; border-radius: 50%; background: var(--offline); display: block; }
.state-online .state { color: var(--online); }
.state-online .state i { background: var(--online); box-shadow: 0 0 10px var(--online); animation: breathe 2.6s ease-in-out infinite; }
.state-syncing .state { color: var(--syncing); }
.state-syncing .state i { background: var(--syncing); animation: breathe 1s ease-in-out infinite; }
.state-error .state { color: var(--error); }
.state-error .state i { background: var(--error); }
.state-offline .state { color: var(--ink-3); }
.state-unpaired .state { color: var(--accent); }
.state-unpaired .state i { background: var(--accent); }

@keyframes breathe { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }

.rows { border-top: 1px solid var(--line-soft); padding-top: 12px; }
.row { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; font-size: 13px; }
.row .k { color: var(--ink-3); }
.row .v { color: var(--ink); text-align: right; font-weight: 600; }
.row .v.dim { color: var(--ink-2); font-weight: 400; }

.card .actions { display: flex; gap: 8px; margin-top: 15px; }

/* ---- Pairing ----------------------------------------------------------- */

.pairing {
  background: linear-gradient(180deg, #171d2b, #14171c);
  border: 1px solid #2b3648;
}
.code {
  font-family: var(--mono); font-size: 30px; font-weight: 700; letter-spacing: .12em;
  color: var(--accent); margin: 6px 0 14px;
}

/* ---- Media ------------------------------------------------------------- */

.drop {
  border: 2px dashed var(--line); border-radius: var(--radius);
  padding: 34px; text-align: center; color: var(--ink-2); cursor: pointer;
  background: var(--panel); transition: border-color .15s, background .15s;
}
.drop:hover, .drop.over { border-color: var(--accent); background: #141a26; color: var(--ink); }
.drop b { display: block; font-size: 16px; color: var(--ink); margin-bottom: 4px; }
.drop small { color: var(--ink-3); }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.tile {
  background: var(--panel); border: 1px solid var(--line-soft);
  border-radius: var(--radius); overflow: hidden;
}
.tile .thumb {
  aspect-ratio: 16 / 9; background: #05070a; display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.tile .thumb img, .tile .thumb video { width: 100%; height: 100%; object-fit: cover; display: block; }
.tile .meta { padding: 11px 12px; }
.tile .meta b { display: block; font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile .meta small { color: var(--ink-3); font-size: 11px; }
.tile .meta .tools { display: flex; gap: 6px; margin-top: 9px; }

/* Scoped to the tile on purpose: an unscoped `.kind` with position:absolute
 * lands on top of every other thing in this app that has a kind. */
.tile .kind {
  position: absolute; margin: 8px; padding: 2px 7px; border-radius: 5px;
  background: rgba(0, 0, 0, .7); font-size: 10px; font-weight: 800; letter-spacing: .1em;
}
.tile .thumb { position: relative; }

/* ---- Playlists --------------------------------------------------------- */

.split { display: grid; grid-template-columns: 250px 1fr; gap: 20px; align-items: start; }
/* The editor row carries a thumbnail, a name, a slot toggle, a duration and
 * four buttons. Below this the sidebar has to stop competing with it. */
@media (max-width: 980px) { .split { grid-template-columns: 1fr; } }

.list { background: var(--panel); border: 1px solid var(--line-soft); border-radius: var(--radius); overflow: hidden; }
.list button {
  display: block; width: 100%; text-align: left; background: none; border: 0;
  padding: 13px 15px; cursor: pointer; border-bottom: 1px solid var(--line-soft);
}
.list button:last-child { border-bottom: 0; }
.list button:hover { background: var(--panel-2); }
.list button.on { background: var(--panel-2); box-shadow: inset 3px 0 0 var(--accent); }
.list button b { display: block; font-size: 14px; font-weight: 600; }
.list button small { color: var(--ink-3); font-size: 12px; }

.items { background: var(--panel); border: 1px solid var(--line-soft); border-radius: var(--radius); padding: 16px; }
.item {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 10px; border: 1px solid var(--line-soft); border-radius: var(--radius-sm);
  background: var(--panel-2); margin-bottom: 8px;
}
/* Wrapping rather than overflowing: a row that runs off the side of the page
 * takes the whole layout with it, and the controls are all still usable
 * stacked. */
.item .name { flex: 1 1 150px; }
.item.drag-over { border-color: var(--accent); }
.item .handle { color: var(--ink-3); cursor: grab; font-size: 16px; user-select: none; }
.item .pic { width: 72px; height: 41px; border-radius: 5px; overflow: hidden; background: #05070a; flex: none; }
.item .pic img, .item .pic video { width: 100%; height: 100%; object-fit: cover; }
.item .name { flex: 1; min-width: 0; }
.item .name b { display: block; font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item .name small { color: var(--ink-3); font-size: 11px; }
.item input[type=number] { width: 78px; }

.dirty-bar {
  position: sticky; bottom: 0; margin-top: 14px; padding: 12px;
  background: var(--panel-2); border: 1px solid var(--accent); border-radius: var(--radius-sm);
  display: flex; align-items: center; gap: 12px; font-size: 13px;
}

/* ---- Panel ------------------------------------------------------------- */

.scrim {
  position: fixed; inset: 0; background: rgba(4, 6, 9, .72); z-index: 50;
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.panel {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); width: min(560px, 100%); max-height: 86vh; overflow: auto; padding: 22px;
}
.panel h3 { margin: 0 0 4px; font-size: 20px; }
.panel .sub { color: var(--ink-3); font-size: 13px; margin-bottom: 18px; }
.panel .foot { display: flex; gap: 8px; margin-top: 20px; }
.panel .foot .spacer { flex: 1; }

/* ---- Empty / toast ----------------------------------------------------- */

.empty {
  background: var(--panel); border: 1px dashed var(--line); border-radius: var(--radius);
  padding: 40px; text-align: center; color: var(--ink-2);
}
.empty b { display: block; color: var(--ink); font-size: 16px; margin-bottom: 5px; }

#toast {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%) translateY(20px);
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 99px;
  padding: 11px 20px; font-size: 14px; box-shadow: var(--shadow);
  opacity: 0; pointer-events: none; transition: opacity .18s, transform .18s; z-index: 90;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
#toast.bad { border-color: var(--error); color: #ffd5d5; }

/* ---- Login ------------------------------------------------------------- */

#login { position: fixed; inset: 0; background: var(--bg); display: flex; align-items: center; justify-content: center; z-index: 100; }
#login .box { width: min(360px, 90vw); text-align: center; }
#login .wordmark { justify-content: center; font-size: 30px; margin-bottom: 8px; }
#login p { color: var(--ink-3); font-size: 13px; margin: 0 0 22px; }
#login .err { color: var(--error); font-size: 13px; min-height: 18px; margin-top: 10px; }

/* ---- The broadcast timeline -------------------------------------------- *
 *
 * The signature view: one screen's loop drawn end to end, block width equal to
 * runtime, with a marker where the picture actually is. The point of drawing
 * it to scale is that a fifteen-second slot in a ninety-second loop should
 * LOOK like a sixth of the wall's attention, because that is what is being
 * sold.
 */

.tl-back {
  background: none; border: 0; color: var(--ink-2); cursor: pointer;
  font-size: 13px; font-weight: 600; padding: 6px 0; margin-bottom: 14px;
}
.tl-back:hover { color: var(--ink); }

.tl {
  background: var(--panel); border: 1px solid var(--line-soft);
  border-radius: var(--radius); padding: 22px;
}

.tl-head { display: flex; gap: 20px; align-items: flex-start; margin-bottom: 26px; }
.tl-head .left { flex: 1; min-width: 0; }
.tl-head .right { text-align: right; flex: none; max-width: 45%; }

.tl-tag {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase;
  color: var(--ink-2); margin-bottom: 6px;
}
.tl-tag i { width: 9px; height: 9px; border-radius: 50%; background: var(--offline); }
.tl.state-online .tl-tag i { background: var(--online); box-shadow: 0 0 10px var(--online); animation: breathe 2.6s ease-in-out infinite; }
.tl.state-syncing .tl-tag i { background: var(--syncing); animation: breathe 1s ease-in-out infinite; }
.tl.state-error .tl-tag i { background: var(--error); }
.tl.state-unpaired .tl-tag i { background: var(--accent); }

.tl-head h2 { margin: 0 0 4px; font-size: 26px; font-weight: 700; letter-spacing: -.02em; }
.tl-head .meta { color: var(--ink-3); font-size: 13px; }
.tl-head .cue {
  font-size: 11px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase;
  color: var(--ink-3); margin-bottom: 5px;
}
.tl-head .now { font-size: 19px; font-weight: 700; letter-spacing: -.01em; }
.tl-head .left-in { color: var(--ink-3); font-size: 13px; margin-top: 3px; }

/* The ruler. Ticks are placed by percentage so they stay honest at any width. */
.tl-ruler { position: relative; height: 16px; margin-bottom: 6px; }
.tl-ruler span {
  position: absolute; top: 0; font-size: 11px; color: var(--ink-3);
  transform: translateX(-50%); white-space: nowrap;
}
.tl-ruler span:first-child { transform: none; }
.tl-ruler span:last-child { transform: translateX(-100%); }

.tl-track {
  position: relative; display: flex; overflow: hidden;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: #05070a; min-height: 96px;
}

.tl-block {
  position: relative; min-width: 0; padding: 14px 14px 12px;
  border-right: 1px solid var(--line); background: var(--panel-2);
  cursor: pointer; text-align: left; color: inherit;
  display: flex; flex-direction: column; justify-content: space-between;
  transition: background .12s;
}
.tl-block:last-child { border-right: 0; }
.tl-block:hover { background: #222831; }
.tl-block.on { box-shadow: inset 0 0 0 2px var(--accent); }

/* DAN inventory reads as a different substance from the venue's own content —
 * the whole reason the view exists is to see, at a glance, how much of a wall
 * is sellable. */
.tl-block.dan { background: #16241a; border-right-color: #27402c; }
.tl-block.dan:hover { background: #1b2d1f; }

.tl-block .kind {
  font-size: 10px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase;
  color: var(--ink-3); margin-bottom: 6px; white-space: nowrap; overflow: hidden;
}
.tl-block.dan .kind { color: #6fbe82; }
.tl-block .title {
  font-size: 14px; font-weight: 700; line-height: 1.25;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.tl-block .who {
  font-size: 10px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase;
  color: var(--ink-3); margin-top: 8px; white-space: nowrap; overflow: hidden;
}
.tl-block.dan .who { color: #6fbe82; }
/* Narrow slots drop their text rather than showing three crushed letters. */
.tl-block.tight { padding: 14px 6px; }
.tl-block.tight .title, .tl-block.tight .who { display: none; }

.tl-playhead {
  position: absolute; top: 0; bottom: 0; width: 2px; background: var(--accent);
  box-shadow: 0 0 10px rgba(91, 140, 255, .8); pointer-events: none; z-index: 2;
}
.tl-playhead::before {
  content: ''; position: absolute; top: -4px; left: -3px;
  width: 8px; height: 8px; border-radius: 50%; background: var(--accent);
}
.tl-playhead.estimated { opacity: .55; }

.tl-foot {
  display: flex; align-items: center; gap: 16px; margin-top: 14px;
  font-size: 13px; color: var(--ink-2); flex-wrap: wrap;
}
.tl-foot .sel { flex: 1; min-width: 200px; }
.tl-foot .sel b { color: var(--ink); }
.tl-legend { display: flex; gap: 14px; font-size: 12px; color: var(--ink-3); }
.tl-legend span { display: flex; align-items: center; gap: 6px; }
.tl-legend i { width: 10px; height: 10px; border-radius: 3px; background: var(--panel-2); border: 1px solid var(--line); }
.tl-legend i.dan { background: #16241a; border-color: #27402c; }

.tl-note {
  margin-top: 14px; padding: 12px 14px; border-radius: var(--radius-sm);
  background: var(--panel-2); border: 1px solid var(--line); font-size: 13px; color: var(--ink-2);
}

/* ---- Segmented control (screen type, slot type) ------------------------ */

.seg { display: flex; gap: 10px; }
.seg button {
  flex: 1; display: flex; align-items: center; gap: 10px; cursor: pointer;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 13px 14px; text-align: left; color: var(--ink);
}
.seg button:hover { border-color: #39404b; }
.seg button.on { border-color: var(--accent); background: #131b2b; }
.seg button .dot {
  width: 15px; height: 15px; border-radius: 50%; border: 2px solid var(--line);
  flex: none; margin-left: auto;
}
.seg button.on .dot { border-color: var(--accent); background: var(--accent); box-shadow: inset 0 0 0 3px #131b2b; }
.seg button b { display: block; font-size: 14px; font-weight: 600; }
.seg button small { display: block; color: var(--ink-3); font-size: 12px; }

/* The compact variant used per playlist row. */
.seg.mini { gap: 0; border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; }
.seg.mini button {
  border: 0; border-radius: 0; padding: 6px 11px; font-size: 12px; font-weight: 700;
  letter-spacing: .06em; text-transform: uppercase; background: transparent;
  justify-content: center; color: var(--ink-3);
}
.seg.mini button.on { background: var(--panel-2); color: var(--ink); }
.seg.mini button.on.dan { background: #16241a; color: #6fbe82; }

label.field .hint { font-size: 12px; color: var(--ink-3); margin-top: 6px; font-weight: 400;
  letter-spacing: 0; text-transform: none; }
label.field .count { float: right; font-size: 11px; color: var(--ink-3); font-weight: 400; }

.panel .x {
  position: absolute; top: 16px; right: 16px; background: none; border: 0;
  color: var(--ink-3); font-size: 20px; line-height: 1; cursor: pointer; padding: 6px;
}
.panel .x:hover { color: var(--ink); }
.panel { position: relative; }

/* ---- The 600-foot view -------------------------------------------------- *
 *
 * Four numbers, a short list of what is wrong, and every wall in the network
 * as a live bar. The bars are the point: at a glance you can see which screens
 * are moving, which are frozen, and how much green — sellable airtime — the
 * network actually has.
 */

.stats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 14px; margin-bottom: 8px;
}
.stat {
  background: var(--panel); border: 1px solid var(--line-soft);
  border-radius: var(--radius); padding: 18px 20px;
}
.stat .k {
  font-size: 11px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase;
  color: var(--ink-3); margin-bottom: 10px;
}
.stat .v { font-size: 34px; font-weight: 800; letter-spacing: -.03em; line-height: 1; }
.stat .v small { font-size: 18px; font-weight: 600; color: var(--ink-3); letter-spacing: 0; }
.stat .sub { color: var(--ink-3); font-size: 13px; margin-top: 8px; }
.stat.good .v { color: var(--online); }
.stat.bad .v { color: var(--error); }
.stat.dan .v { color: #6fbe82; }

/* A share bar under the inventory number — the figure this whole product
 * exists to move. */
.share { height: 6px; border-radius: 3px; background: var(--panel-2); overflow: hidden; margin-top: 12px; }
.share i { display: block; height: 100%; background: #6fbe82; }

.att { display: flex; flex-direction: column; gap: 8px; }
.att-row {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  background: var(--panel); border: 1px solid var(--line-soft); border-left: 3px solid var(--offline);
  border-radius: var(--radius-sm); padding: 12px 14px; cursor: pointer; color: inherit;
}
.att-row:hover { background: var(--panel-2); }
.att-row.error { border-left-color: var(--error); }
.att-row.warn { border-left-color: var(--syncing); }
.att-row.info { border-left-color: var(--accent); }
.att-row b { font-size: 14px; font-weight: 600; }
.att-row .where { color: var(--ink-3); font-size: 12px; }
.att-row .why { margin-left: auto; color: var(--ink-2); font-size: 13px; text-align: right; }

.net { display: flex; flex-direction: column; gap: 10px; }
.net-row {
  display: grid; grid-template-columns: 210px 1fr 190px; gap: 16px; align-items: center;
  background: var(--panel); border: 1px solid var(--line-soft);
  border-radius: var(--radius); padding: 12px 16px; cursor: pointer;
}
.net-row:hover { background: var(--panel-2); }
.net-who { min-width: 0; }
.net-who b { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 700; }
.net-who b i { width: 8px; height: 8px; border-radius: 50%; background: var(--offline); flex: none; }
.net-row.state-online .net-who b i { background: var(--online); box-shadow: 0 0 8px var(--online); animation: breathe 2.6s ease-in-out infinite; }
.net-row.state-syncing .net-who b i { background: var(--syncing); animation: breathe 1s ease-in-out infinite; }
.net-row.state-error .net-who b i { background: var(--error); }
.net-row.state-unpaired .net-who b i { background: var(--accent); }
.net-who small { display: block; color: var(--ink-3); font-size: 12px; margin-top: 3px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.net-bar {
  position: relative; display: flex; height: 34px; overflow: hidden;
  border: 1px solid var(--line); border-radius: 7px; background: #05070a;
}
.net-seg { height: 100%; border-right: 1px solid var(--line); background: var(--panel-2); }
.net-seg:last-child { border-right: 0; }
.net-seg.dan { background: #16241a; border-right-color: #27402c; }
.net-bar .tl-playhead { width: 2px; }
.net-bar .empty-loop {
  display: flex; align-items: center; justify-content: center; width: 100%;
  font-size: 12px; color: var(--ink-3);
}

.net-now { text-align: right; min-width: 0; }
.net-now b { display: block; font-size: 13px; font-weight: 600;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.net-now small { color: var(--ink-3); font-size: 12px; }

@media (max-width: 860px) {
  .net-row { grid-template-columns: 1fr; gap: 10px; }
  .net-now { text-align: left; }
}

/* ---- Loop preview, in the playlist editor ------------------------------ *
 *
 * The same bar the network view draws, over the thing being edited. A playlist
 * is a shape, and you should be able to see the shape while you are making it
 * — including how much of it is sellable.
 */
.loop-preview { margin-bottom: 16px; }
.loop-preview .bar {
  display: flex; height: 30px; overflow: hidden;
  border: 1px solid var(--line); border-radius: 7px; background: #05070a;
}
.loop-preview .bar div { height: 100%; border-right: 1px solid var(--line); background: var(--panel-2); }
.loop-preview .bar div:last-child { border-right: 0; }
.loop-preview .bar div.dan { background: #16241a; border-right-color: #27402c; }
.loop-preview .cap {
  display: flex; gap: 14px; flex-wrap: wrap; align-items: center;
  margin-top: 8px; font-size: 12px; color: var(--ink-3);
}
.loop-preview .cap b { color: var(--ink); font-weight: 700; }
.loop-preview .cap .dan-share { color: #6fbe82; font-weight: 700; }

/* ---- Adding media to a playlist ---------------------------------------- *
 *
 * A dropdown of filenames is a filing cabinet. Building a loop is a visual
 * job — you are choosing what a room looks like — so the library is a strip of
 * the actual artwork, and the whole editor takes files dropped on it.
 */

.picker-head {
  display: flex; align-items: baseline; gap: 10px; margin: 18px 0 10px;
  font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
  color: var(--ink-3);
}
.picker-head small { font-weight: 400; letter-spacing: 0; text-transform: none; font-size: 12px; }

.picker {
  display: flex; gap: 10px; overflow-x: auto; padding: 2px 2px 8px;
  scrollbar-width: thin;
}
.pick {
  flex: none; width: 132px; padding: 0; overflow: hidden; cursor: pointer;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius-sm);
  color: inherit; text-align: left; position: relative;
}
.pick:hover { border-color: var(--accent); }
.pick .shot { aspect-ratio: 16 / 9; background: #05070a; display: block; }
.pick .shot img, .pick .shot video { width: 100%; height: 100%; object-fit: cover; display: block; }
.pick .cap { padding: 7px 8px 8px; }
.pick .cap b { display: block; font-size: 12px; font-weight: 600;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pick .cap small { color: var(--ink-3); font-size: 11px; }
/* The affordance only shows up when you are looking at it. */
.pick .plus {
  position: absolute; top: 6px; right: 6px; width: 22px; height: 22px; border-radius: 50%;
  background: var(--accent); color: var(--accent-ink); font-size: 15px; font-weight: 700;
  line-height: 22px; text-align: center; opacity: 0; transition: opacity .12s;
}
.pick:hover .plus { opacity: 1; }
.pick .badge {
  position: absolute; top: 6px; left: 6px; padding: 2px 6px; border-radius: 4px;
  background: rgba(0, 0, 0, .75); font-size: 9px; font-weight: 800; letter-spacing: .1em;
}

/* Dropping files straight onto the playlist: upload, then append. */
.items.over { outline: 2px dashed var(--accent); outline-offset: -4px; }
.drop-hint {
  margin-top: 10px; padding: 12px; border: 1px dashed var(--line); border-radius: var(--radius-sm);
  text-align: center; font-size: 12px; color: var(--ink-3);
}

/* ---- The wall of walls -------------------------------------------------- *
 *
 * Each screen as a screen: the artwork that is actually on it, the loop under
 * it, and the marker moving. A bar tells you the shape of a loop; only the
 * picture tells you what a room is looking at.
 */

.wall { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }

.wall-card {
  background: var(--panel); border: 1px solid var(--line-soft); border-radius: var(--radius);
  overflow: hidden; cursor: pointer; text-align: left; color: inherit; padding: 0;
  display: flex; flex-direction: column;
}
.wall-card:hover { border-color: #39404b; }

/* The glass. Black, 16:9, and the artwork fitted inside it rather than cropped
 * — a crop here would misrepresent what the room is seeing. */
.wall-screen {
  position: relative; aspect-ratio: 16 / 9; background: #000;
  display: flex; align-items: center; justify-content: center;
  border-bottom: 1px solid var(--line-soft);
}
.wall-screen img, .wall-screen video {
  width: 100%; height: 100%; object-fit: contain; display: block;
}
.wall-screen .dark {
  font-size: 13px; color: var(--ink-3); text-align: center; padding: 0 20px;
}
.wall-screen .state {
  position: absolute; top: 10px; left: 10px; margin: 0; padding: 4px 9px;
  border-radius: 99px; background: rgba(5, 7, 10, .78); backdrop-filter: blur(6px);
  font-size: 10px;
}
.wall-screen .slot {
  position: absolute; top: 10px; right: 10px; padding: 4px 9px; border-radius: 99px;
  background: rgba(5, 7, 10, .78); backdrop-filter: blur(6px);
  font-size: 10px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase;
  color: #6fbe82;
}

.wall-body { padding: 14px 16px 16px; }
.wall-body h3 { margin: 0 0 2px; font-size: 16px; font-weight: 700; letter-spacing: -.01em; }
.wall-body .where { color: var(--ink-3); font-size: 12px; margin-bottom: 12px; }

.wall-bar {
  position: relative; display: flex; height: 8px; overflow: hidden;
  border-radius: 4px; background: #05070a; border: 1px solid var(--line);
}
.wall-bar div { height: 100%; border-right: 1px solid var(--line); background: var(--panel-2); }
.wall-bar div:last-child { border-right: 0; }
.wall-bar div.dan { background: #2a4a32; border-right-color: #27402c; }
.wall-bar .tl-playhead { width: 2px; }

.wall-now {
  display: flex; justify-content: space-between; gap: 10px; align-items: baseline;
  margin-top: 10px; font-size: 13px;
}
.wall-now b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wall-now small { color: var(--ink-3); font-size: 12px; flex: none; }
