/* Dark, card-based control dashboard. Written for old Safari too: no CSS grid or variables. */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: #0f1115; color: #e6e8eb;
  font: 14px/1.45 -apple-system, BlinkMacSystemFont, "Helvetica Neue", Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased; }
a { color: #4c8dff; text-decoration: none; }
button, input, select { font: inherit; color: inherit; }
.boot { padding: 60px 20px; text-align: center; color: #8a919c; }
.muted { color: #8a919c; }
.small { font-size: 12px; }
.hidden { display: none !important; }

/* ---------- top bar ---------- */
.top { position: fixed; top: 0; left: 0; right: 0; height: 56px; background: #15171c; border-bottom: 1px solid #23272e;
  display: -webkit-flex; display: flex; -webkit-align-items: center; align-items: center; padding: 0 16px; z-index: 20; }
.brand { display: -webkit-flex; display: flex; -webkit-align-items: center; align-items: center; font-weight: 600; font-size: 15px; letter-spacing: .2px; }
.mark { width: 28px; height: 28px; border-radius: 8px; background: #2f6bff; margin-right: 10px; position: relative; }
.mark:before { content: ""; position: absolute; left: 7px; top: 8px; width: 14px; height: 10px; border: 2px solid #fff; border-radius: 2px; }
.mark:after { content: ""; position: absolute; left: 11px; top: 21px; width: 6px; height: 2px; background: #fff; }
.spacer { -webkit-flex: 1; flex: 1; }
.pill { display: inline-block; padding: 4px 10px 4px 22px; border-radius: 20px; background: #1e2128; border: 1px solid #2a2e36;
  font-size: 12px; position: relative; white-space: nowrap; }
.pill:before { content: ""; position: absolute; left: 9px; top: 50%; margin-top: -4px; width: 8px; height: 8px; border-radius: 4px; background: #6b7280; }
.pill.on:before { background: #2fd27a; box-shadow: 0 0 6px #2fd27a; }
.pill.warn:before { background: #f5a524; }
.pill.off:before { background: #f04f4f; }
.who { margin-left: 12px; color: #a4abb6; font-size: 13px; white-space: nowrap; }
.who button { margin-left: 8px; }

/* ---------- side and bottom navigation ---------- */
.side { position: fixed; top: 56px; bottom: 0; left: 0; width: 210px; background: #15171c; border-right: 1px solid #23272e; padding: 14px 10px; }
.nav a { display: -webkit-flex; display: flex; -webkit-align-items: center; align-items: center; padding: 10px 12px; margin-bottom: 2px;
  border-radius: 8px; color: #b7bdc6; font-weight: 500; }
.nav a:hover { background: #1d2027; color: #fff; }
.nav a.active { background: #1f2a44; color: #fff; }
.nav a.active .ico { border-color: #4c8dff; }
.ico { width: 16px; height: 16px; border: 2px solid #8a919c; border-radius: 4px; margin-right: 12px; display: inline-block; -webkit-flex-shrink: 0; flex-shrink: 0; }
.ico.round { border-radius: 8px; }
.ico.up { border-radius: 2px; border-top-width: 5px; }
.ico.grid { border-style: dotted; }
.ico.gear { border-radius: 8px; border-style: dashed; }
.main { margin-left: 210px; padding: 80px 28px 40px; max-width: 1400px; }
.bottom { display: none; }

@media (max-width: 860px) {
  .side { display: none; }
  .main { margin-left: 0; padding: 72px 14px 96px; }
  .bottom { display: -webkit-flex; display: flex; position: fixed; bottom: 0; left: 0; right: 0; background: #15171c; border-top: 1px solid #23272e;
    padding: 6px 4px 10px; z-index: 20; }
  .bottom a { -webkit-flex: 1; flex: 1; text-align: center; color: #8a919c; font-size: 11px; padding: 6px 0; }
  .bottom a .ico { display: block; margin: 0 auto 4px; }
  .bottom a.active { color: #fff; }
  .bottom a.active .ico { border-color: #4c8dff; }
  .who .name { display: none; }
}

/* ---------- page bits ---------- */
h1.page { font-size: 22px; font-weight: 600; margin: 0 0 4px; }
.sub { color: #8a919c; margin: 0 0 22px; }
h2.sec { font-size: 13px; text-transform: uppercase; letter-spacing: .8px; color: #8a919c; font-weight: 600; margin: 28px 0 12px; }
.row { display: -webkit-flex; display: flex; -webkit-flex-wrap: wrap; flex-wrap: wrap; margin: 0 -7px; }
.card { background: #1a1d23; border: 1px solid #262a31; border-radius: 12px; padding: 16px; margin: 0 7px 14px; }
.tiles .card { -webkit-flex: 1 1 200px; flex: 1 1 200px; min-width: 160px; }
.tile-label { font-size: 12px; color: #8a919c; text-transform: uppercase; letter-spacing: .6px; }
.tile-value { font-size: 20px; font-weight: 600; margin-top: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile-foot { font-size: 12px; color: #8a919c; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* live view */
.livecard { -webkit-flex: 1 1 100%; flex: 1 1 100%; padding: 0; overflow: hidden; }
.live-head { display: -webkit-flex; display: flex; -webkit-align-items: center; align-items: center; padding: 12px 16px; border-bottom: 1px solid #262a31; }
.live-head .title { font-weight: 600; }
.badge { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .6px; padding: 2px 7px; border-radius: 4px; background: #2a2e36; color: #cfd3d9; margin-left: 10px; }
.badge.live { background: #e5484d; color: #fff; }
.badge.playing { background: #1d3b2a; color: #45e08f; }
.screen { position: relative; background: #000; height: 0; padding-bottom: 42%; }
.screen .pic { position: absolute; top: 0; left: 0; right: 0; bottom: 0; background: center center no-repeat; background-size: contain; }
.screen .empty { position: absolute; top: 50%; left: 0; right: 0; margin-top: -10px; text-align: center; color: #6b7280; }
.screen.gfxmode { padding-bottom: 56.25%; }
.screen .gframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: 0; pointer-events: none; }
/* slideshow preview window */
.pmodal { position: fixed; top: 0; left: 0; right: 0; bottom: 0; z-index: 50; background: rgba(0,0,0,0.78); padding: 4vh 4vw; overflow: auto; }
.pwin { max-width: 1280px; margin: 0 auto; background: #1a1d23; border: 1px solid #262a31; border-radius: 12px; overflow: hidden; }
.pscreen { position: relative; height: 0; padding-bottom: 56.25%; background: #000; }
.pscreen .pframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: 0; }
@media (max-width: 520px) { .pmodal { padding: 12px; } .pwin .live-head .muted { display: none; } }
.caption { padding: 10px 16px; color: #a4abb6; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* folder cards */
.folders .card { -webkit-flex: 0 0 230px; flex: 0 0 230px; width: 230px; padding: 0; overflow: hidden; cursor: pointer; }
.folders .card:hover { border-color: #3a4150; }
.folders .card.playing { border-color: #2fd27a; }
.mosaic { height: 130px; background: #111317; position: relative; overflow: hidden; }
.mosaic div { position: absolute; background: #1d2027 center center no-repeat; background-size: cover; }
.mosaic .m1 { top: 0; left: 0; right: 0; bottom: 0; }
.mosaic.n2 .m1, .mosaic.n3 .m1, .mosaic.n4 .m1 { right: 50%; margin-right: 1px; }
.mosaic.n2 .m2 { top: 0; bottom: 0; left: 50%; right: 0; margin-left: 1px; }
.mosaic.n3 .m2, .mosaic.n4 .m2 { top: 0; bottom: 50%; left: 50%; right: 0; margin: 0 0 1px 1px; }
.mosaic.n3 .m3 { top: 50%; bottom: 0; left: 50%; right: 0; margin: 1px 0 0 1px; }
.mosaic.n4 .m3 { top: 50%; bottom: 0; left: 50%; right: 25%; margin: 1px 1px 0 1px; }
.mosaic.n4 .m4 { top: 50%; bottom: 0; left: 75%; right: 0; margin: 1px 0 0 1px; }
.mosaic .none { top: 50%; left: 0; right: 0; margin-top: -9px; text-align: center; color: #555b66; background: none; font-size: 12px; }
.fbody { padding: 12px 14px; }
.fname { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fmeta { display: -webkit-flex; display: flex; -webkit-align-items: center; align-items: center; margin-top: 6px; color: #8a919c; font-size: 12px; }
.fmeta .btn { margin-left: auto; }
@media (max-width: 520px) { .folders .card { -webkit-flex: 1 1 45%; flex: 1 1 45%; width: auto; } .mosaic { height: 100px; } }

/* buttons and forms */
.btn { display: inline-block; border: 1px solid #323843; background: #232730; color: #e6e8eb; border-radius: 8px; padding: 7px 14px; cursor: pointer; font-weight: 500; font-size: 13px; }
.btn:hover { background: #2a2f39; }
.btn.primary { background: #2f6bff; border-color: #2f6bff; color: #fff; }
.btn.primary:hover { background: #4a7fff; }
.btn.danger { background: #3a1d21; border-color: #5a2a30; color: #ff8a8a; }
.btn.small { padding: 4px 10px; font-size: 12px; }
.btn[disabled] { opacity: .45; cursor: default; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12px; color: #a4abb6; margin-bottom: 6px; font-weight: 500; }
.input, select.input { width: 100%; background: #111317; border: 1px solid #2d323b; border-radius: 8px; padding: 9px 11px; color: #e6e8eb; outline: none; }
.input:focus { border-color: #2f6bff; }
.check { display: -webkit-flex; display: flex; -webkit-align-items: center; align-items: center; cursor: pointer; }
.check input { margin-right: 8px; }
.err { color: #ff8a8a; margin: 8px 0 0; font-size: 13px; }
.ok { color: #45e08f; margin: 8px 0 0; font-size: 13px; }
.formcard { max-width: 560px; -webkit-flex: 1 1 100%; flex: 1 1 100%; }
.inline { display: -webkit-flex; display: flex; }
.inline .input { -webkit-flex: 1; flex: 1; margin-right: 8px; }

/* login */
.center { min-height: 100vh; display: -webkit-flex; display: flex; -webkit-align-items: center; align-items: center; -webkit-justify-content: center; justify-content: center; padding: 20px; }
.login { width: 100%; max-width: 380px; margin: 0; padding: 28px; }
.login .brand { margin-bottom: 22px; font-size: 18px; }
.login .btn { width: 100%; padding: 10px; margin-top: 4px; }

/* photo manager */
.toolbar { display: -webkit-flex; display: flex; -webkit-flex-wrap: wrap; flex-wrap: wrap; -webkit-align-items: center; align-items: center; margin-bottom: 14px; }
.toolbar > * { margin: 0 8px 8px 0; }
.toolbar select.input { width: auto; min-width: 220px; max-width: 100%; }
.photos { display: -webkit-flex; display: flex; -webkit-flex-wrap: wrap; flex-wrap: wrap; margin: 0 -5px; }
.ph { width: 150px; margin: 0 5px 10px; background: #1a1d23; border: 2px solid #262a31; border-radius: 10px; overflow: hidden; cursor: pointer; position: relative; }
.ph.sel { border-color: #2f6bff; }
.ph .img { height: 112px; background: #111317 center center no-repeat; background-size: cover; }
.ph .num { position: absolute; top: 6px; left: 6px; background: rgba(0,0,0,.65); color: #fff; font-size: 11px; font-weight: 600; padding: 1px 6px; border-radius: 4px; }
.ph .tick { position: absolute; top: 6px; right: 6px; width: 20px; height: 20px; border-radius: 10px; border: 2px solid rgba(255,255,255,.8); background: rgba(0,0,0,.35); }
.ph.sel .tick { background: #2f6bff; border-color: #2f6bff; }
.ph.sel .tick:after { content: ""; position: absolute; left: 5px; top: 1px; width: 4px; height: 9px; border: solid #fff; border-width: 0 2px 2px 0; -webkit-transform: rotate(45deg); transform: rotate(45deg); }
.ph .nm { padding: 6px 8px; font-size: 11px; color: #a4abb6; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 520px) { .ph { width: 31%; width: calc(33.33% - 10px); } .ph .img { height: 90px; } }
.notice { background: #1f2a44; border: 1px solid #2c3d63; color: #cdd9f5; padding: 10px 14px; border-radius: 8px; margin-bottom: 14px; font-size: 13px; }

/* upload */
.drop { border: 2px dashed #323843; border-radius: 12px; padding: 34px 16px; text-align: center; color: #a4abb6; cursor: pointer; background: #15171c; }
.drop.over { border-color: #2f6bff; background: #161d2e; }
.drop strong { display: block; color: #e6e8eb; font-size: 16px; margin-bottom: 4px; }
.queue { margin-top: 14px; }
.qi { display: -webkit-flex; display: flex; -webkit-align-items: center; align-items: center; padding: 8px 0; border-bottom: 1px solid #23272e; font-size: 13px; }
.qi .qn { -webkit-flex: 1; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-right: 10px; }
.bar { width: 120px; height: 6px; background: #262a31; border-radius: 3px; overflow: hidden; margin-right: 10px; }
.bar div { height: 100%; width: 0; background: #2f6bff; }
.qi.done .bar div { background: #2fd27a; }
.qi.fail .bar div { background: #f04f4f; }
.qs { width: 70px; text-align: right; color: #8a919c; font-size: 12px; }

/* tables */
table.list { width: 100%; border-collapse: collapse; }
table.list td, table.list th { text-align: left; padding: 10px 8px; border-bottom: 1px solid #23272e; font-size: 13px; }
table.list th { color: #8a919c; font-weight: 500; font-size: 12px; text-transform: uppercase; letter-spacing: .5px; }
table.list td.act { text-align: right; white-space: nowrap; }
table.list td.act .btn { margin-left: 6px; }

.toast { position: fixed; left: 50%; bottom: 28px; -webkit-transform: translateX(-50%); transform: translateX(-50%); background: #23272e; border: 1px solid #323843;
  color: #fff; padding: 10px 18px; border-radius: 10px; z-index: 50; box-shadow: 0 8px 30px rgba(0,0,0,.4); max-width: 90%; }
@media (max-width: 860px) { .toast { bottom: 90px; } }
@media (max-width: 520px) { .tiles .card { -webkit-flex: 1 1 40%; flex: 1 1 40%; min-width: 0; padding: 12px; } .tile-value { font-size: 17px; } .screen { padding-bottom: 62%; } }

/* graphic slide switches (Overview) */
.graphics .gcard { -webkit-flex: 1 1 300px; flex: 1 1 300px; display: -webkit-flex; display: flex; -webkit-align-items: center; align-items: center; cursor: pointer; }
.graphics .gcard:hover { border-color: #3a4150; }
.gcard.playing { border-color: #2f6bff; }
.gtext { -webkit-flex: 1; flex: 1; min-width: 0; }
.gtext .fmeta { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.gstate { font-size: 12px; font-weight: 700; letter-spacing: .6px; color: #8a919c; margin: 0 12px; text-transform: uppercase; }
.gstate.on { color: #45e08f; }
.switch { position: relative; width: 46px; height: 26px; border-radius: 13px; border: none; background: #3a3f49; cursor: pointer; padding: 0; -webkit-flex-shrink: 0; flex-shrink: 0; }
.switch span { position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 10px; background: #fff; -webkit-transition: left .15s; transition: left .15s; }
.switch.on { background: #2f6bff; }
.switch.on span { left: 23px; }

/* background sky override (Overview) */
.graphics .gcard.sky { cursor: default; -webkit-flex-wrap: wrap; flex-wrap: wrap; }
.graphics .gcard.sky .gtext { -webkit-flex: 1 1 220px; flex: 1 1 220px; }
.graphics .gcard.sky:hover { border-color: #262a31; }
.seg { display: -webkit-flex; display: flex; -webkit-flex-wrap: wrap; flex-wrap: wrap; background: #121418; border: 1px solid #323843; border-radius: 9px; padding: 3px; margin: 6px 0 6px 12px; }
.segbtn { border: none; background: transparent; color: #b8bec8; font: inherit; font-size: 13px; font-weight: 600; padding: 7px 12px; border-radius: 7px; cursor: pointer; }
.segbtn:hover { color: #fff; }
.segbtn.on { background: #2f6bff; color: #fff; }
@media (max-width: 520px) { .seg { margin-left: 0; width: 100%; } .segbtn { -webkit-flex: 1; flex: 1; padding: 7px 6px; } }

/* ---------- light mode: the theme button in the top bar adds class "light" to <html> ---------- */
html.light, html.light body { background: #f4f5f7; color: #1d2128; }
html.light a { color: #2459d6; }
html.light .boot, html.light .muted, html.light .sub, html.light h2.sec, html.light .tile-label, html.light .tile-foot,
html.light .fmeta, html.light .qs, html.light table.list th, html.light .gstate { color: #646b76; }
html.light .top, html.light .side, html.light .bottom { background: #ffffff; border-color: #e3e6ea; }
html.light .pill { background: #f1f3f6; border-color: #dfe3e8; }
html.light .who { color: #4d5562; }
html.light .nav a { color: #3b424d; }
html.light .nav a:hover { background: #f1f3f6; color: #111; }
html.light .nav a.active { background: #e6eeff; color: #1340b0; }
html.light .ico { border-color: #8a919c; }
html.light .bottom a { color: #646b76; }
html.light .bottom a.active { color: #1340b0; }
html.light .card, html.light .pwin { background: #ffffff; border-color: #e3e6ea; box-shadow: 0 1px 2px rgba(16,24,40,.04); }
html.light .live-head { border-color: #e3e6ea; }
html.light .badge { background: #eceef2; color: #3b424d; }
html.light .badge.live { background: #e5484d; color: #fff; }
html.light .badge.playing { background: #dff6e9; color: #12804a; }
html.light .caption { color: #4d5562; }
html.light .folders .card:hover, html.light .graphics .gcard:hover { border-color: #c9ced6; }
html.light .graphics .gcard.sky:hover { border-color: #e3e6ea; }
html.light .mosaic, html.light .ph .img { background-color: #eceef2; }
html.light .mosaic div { background-color: #e3e6ea; }
html.light .btn { background: #ffffff; border-color: #d3d8df; color: #1d2128; }
html.light .btn:hover { background: #f1f3f6; }
html.light .btn.primary { background: #2f6bff; border-color: #2f6bff; color: #fff; }
html.light .btn.primary:hover { background: #4a7fff; }
html.light .btn.danger { background: #fdecec; border-color: #f4c4c6; color: #c4262c; }
html.light .field label { color: #4d5562; }
html.light .input, html.light select.input { background: #ffffff; border-color: #d3d8df; color: #1d2128; }
html.light .input:focus { border-color: #2f6bff; }
html.light .err { color: #c4262c; }
html.light .ok { color: #12804a; }
html.light .ph { background: #ffffff; border-color: #e3e6ea; }
html.light .ph.sel { border-color: #2f6bff; }
html.light .ph .nm { color: #4d5562; }
html.light .notice { background: #e6eeff; border-color: #c5d6ff; color: #1d3a80; }
html.light .drop { background: #ffffff; border-color: #c9ced6; color: #4d5562; }
html.light .drop.over { background: #eef3ff; border-color: #2f6bff; }
html.light .drop strong { color: #1d2128; }
html.light .qi, html.light table.list td, html.light table.list th { border-color: #e3e6ea; }
html.light .bar { background: #e3e6ea; }
html.light .toast { background: #1d2128; border-color: #1d2128; color: #fff; }
html.light .gstate.on { color: #12804a; }
html.light .switch { background: #cfd4db; }
html.light .switch.on { background: #2f6bff; }
html.light .seg { background: #f1f3f6; border-color: #dfe3e8; }
html.light .segbtn { color: #3b424d; }
html.light .segbtn:hover { color: #111; }
html.light .segbtn.on { background: #2f6bff; color: #fff; }
html.light .screen, html.light .pscreen { background: #000; }
/* the theme button */
.themebtn { margin-left: 12px; }
.tile-value.good { color: #45e08f; }
.tile-value.warn { color: #f5a524; }
html.light .tile-value.good { color: #12804a; }
html.light .tile-value.warn { color: #b26a00; }
.ico.list { border-radius: 2px; border-left-width: 5px; }
/* profiles */
.ico.stack { border-radius: 3px; box-shadow: 3px -3px 0 -1px #8a919c; }
.profpill { margin-left: 14px; padding: 4px 10px; border-radius: 20px; background: #1f2a44; color: #cdd9f5; font-size: 12px; font-weight: 600; white-space: nowrap; }
.profpill:empty { display: none; }
html.light .profpill { background: #e6eeff; color: #1340b0; }
.card.activeprof { border-color: #2f6bff; }
.logoprev { margin-top: 12px; min-height: 90px; border-radius: 10px; background: #2b4a3a; display: flex; align-items: center; justify-content: center; padding: 14px; color: #cfe0d6; font-size: 13px; }
.logoprev img { max-height: 120px; max-width: 100%; }
@media (max-width: 860px) { .profpill { display: none; } }
.profpick { margin-left: 14px; padding: 4px 8px; border-radius: 8px; background: #1f2a44; color: #cdd9f5; border: 1px solid #2c3d63; font-size: 12px; font-weight: 600; max-width: 220px; }
html.light .profpick { background: #e6eeff; color: #1340b0; border-color: #c5d6ff; }
@media (max-width: 860px) { .profpick { max-width: 130px; margin-left: 8px; } }
/* viewer page */
.vgrid .vstate { -webkit-flex: 1 1 200px; flex: 1 1 200px; min-width: 180px; }
.vstate .gstate { margin: 6px 0 0; }
.vstate.on { border-color: #2f6bff; }
.codeinput { font-size: 24px; letter-spacing: 8px; text-align: center; }
.invrow { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 7px 0; border-bottom: 1px solid #23272e; font-size: 13px; }
html.light .invrow { border-color: #e3e6ea; }
