:root {
  font-family: Inter, "Segoe UI", sans-serif;
  color: #20211f;
  background: #f3f2ee;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  min-height: 100vh;
}
.auth-overlay {
  position: fixed;
  z-index: 20;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(243, 242, 238, 0.96);
}
.auth-pending .management-shell {
  visibility: hidden;
}
.auth-pending .auth-panel {
  visibility: hidden;
}
.auth-panel {
  display: grid;
  gap: 15px;
  width: min(100%, 360px);
  padding: 32px;
  border: 1px solid #d7d6cf;
  border-radius: 9px;
  background: #f8f7f2;
  box-shadow: 0 18px 50px rgba(32, 33, 31, 0.12);
}
.auth-panel h1 {
  margin: 0 0 6px;
  font-size: 30px;
}
.auth-panel label {
  display: grid;
  gap: 7px;
  color: #77776f;
  font-size: 12px;
}
.auth-panel input {
  width: 100%;
  padding: 10px 0;
  border: 0;
  border-bottom: 1px solid #cfcec7;
  background: transparent;
  color: #20211f;
  outline: 0;
}
.auth-panel input:focus {
  border-bottom-color: #676862;
}
.auth-panel button {
  margin-top: 6px;
  padding: 12px 18px;
  border-radius: 8px;
  background: #272825;
  color: #f6f5f0;
}
.login-error {
  min-height: 18px;
  margin: 0;
  color: #87584e;
  font-size: 12px;
  overflow-wrap: anywhere;
}
button,
select {
  font: inherit;
  border: 0;
}
button {
  cursor: pointer;
  outline: 0;
}
aside {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 34px 22px 24px;
  background: #e8e7e1;
  display: flex;
  flex-direction: column;
}
.brand {
  font-size: 17px;
  font-weight: 750;
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 0 12px 46px;
}
nav {
  display: grid;
  gap: 5px;
}
.nav-item,
.folder {
  padding: 12px;
  border-radius: 8px;
  background: transparent;
  color: #6b6b65;
  text-align: left;
}
.nav-item:hover,
.nav-item.active,
.folder:hover {
  background: #dcdad2;
  color: #20211f;
}
.nav-item span {
  float: right;
  color: #85857f;
}
.folder {
  margin-top: auto;
}
main {
  padding: 40px 5vw 60px;
  max-width: 1420px;
  width: 100%;
}
.hidden {
  display: none !important;
}
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 26px;
}
small {
  color: #77776f;
  font-size: 11px;
  letter-spacing: 0.14em;
}
h1 {
  font-size: 36px;
  line-height: 1;
  margin: 7px 0 0;
  letter-spacing: -0.04em;
}
#online {
  color: #6f706a;
  font-size: 14px;
}
.viewer {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 16/9;
  max-height: 59vh;
  background: #171816;
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 28px;
}
.viewer img,
.viewer > video {
  display: none;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.viewer img.active,
.viewer > video.active {
  display: block;
}
.viewer.has-frame #empty {
  display: none;
}
#empty {
  color: #888b84;
}
#live {
  display: none;
  position: absolute;
  left: 15px;
  top: 15px;
  padding: 5px 8px;
  border-radius: 5px;
  background: #ecebe5;
  color: #252624;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
}
.viewer.has-frame #live {
  display: block;
}
.viewer:not(.has-frame) .fullscreen {
  display: none;
}
.fullscreen {
  position: absolute;
  right: 15px;
  top: 15px;
  width: 30px;
  height: 30px;
  padding: 0;
  border-radius: 6px;
  background: rgba(236, 235, 229, 0.88);
  color: #252624;
  font-size: 18px;
  line-height: 30px;
  opacity: 0.78;
  transition: opacity 0.15s ease;
}
.fullscreen:hover {
  opacity: 1;
}
.viewer:fullscreen {
  width: 100vw;
  height: 100vh;
  max-height: none;
  aspect-ratio: auto;
  border-radius: 0;
  margin: 0;
  background: #0f100f;
}
.viewer:fullscreen img,
.viewer:fullscreen > video {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.viewer:fullscreen #empty {
  font-size: 18px;
}
.settings {
  display: grid;
  grid-template-columns: repeat(6, minmax(100px, 1fr));
  gap: 28px;
  margin-bottom: 26px;
}
.display-setting {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 14px;
}
.display-setting > span {
  color: #77776f;
  font-size: 12px;
}
.display-switcher {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.display-unavailable {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.4;
}
.display-switcher button {
  padding: 7px 11px;
  border-radius: 7px;
  background: #e4e2dc;
  color: #65665f;
  font-size: 12px;
}
.display-switcher button.active {
  background: #343531;
  color: #f6f5f0;
}
.settings label {
  display: grid;
  gap: 7px;
  color: #77776f;
  font-size: 12px;
}
.settings select,
.setting-toggle,
.setting-value {
  padding: 10px 0;
  background: transparent;
  border-bottom: 1px solid #cfcec7;
  color: #20211f;
  outline: 0;
  text-align: left;
}
.setting-value {
  min-height: 39px;
  display: flex;
  align-items: center;
  font-variant-numeric: tabular-nums;
}
.setting-toggle {
  width: 100%;
}
.setting-toggle:disabled {
  color: #92938d;
}
.actions {
  display: flex;
  gap: 10px;
}
.actions button {
  padding: 12px 18px;
  border-radius: 8px;
  background: #dfded8;
  color: #292a27;
}
.actions .primary {
  background: #272825;
  color: #f6f5f0;
}
.actions .danger {
  margin-left: auto;
  background: #ded7d1;
  color: #713d31;
}
.actions button:disabled {
  opacity: 0.4;
  cursor: default;
}
#message {
  margin: 18px 0 0;
  color: #72736d;
  font-size: 14px;
  overflow-wrap: anywhere;
}
.saved-actions {
  display: flex;
  gap: 22px;
  margin-top: 12px;
}
.saved-actions button,
.text-button {
  padding: 6px 0;
  background: transparent;
  color: #6f706a;
  font-size: 12px;
}
.saved-actions button span {
  display: inline-block;
  margin-right: 3px;
  font-size: 14px;
}
.saved-actions button:hover {
  color: #20211f;
}
.text-button:hover {
  text-decoration: underline;
}
.library-actions {
  display: flex;
  align-items: center;
  gap: 20px;
}
.clean-button {
  padding: 9px 12px;
  border-radius: 7px;
}
.clean-button {
  background: #ded7d1;
  color: #5b3329;
}
.intro {
  margin: -7px 0 18px;
  color: #77776f;
}
.intro span {
  margin-left: 8px;
  color: #3f403c;
}
.recording-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 34px 24px;
}
.recording-card {
  min-width: 0;
}
.recording-card video {
  display: block;
  width: 100%;
  aspect-ratio: 16/9;
  border-radius: 8px;
  background: #1b1c1a;
  object-fit: contain;
}
.recording-meta {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 5px;
  margin-top: 11px;
}
.recording-name {
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.recording-detail {
  color: #85857f;
  font-size: 12px;
}
.recording-sync {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 4px;
}
.sync-state {
  color: #85857f;
  font-size: 11px;
}
.sync-state.synced {
  color: #52614f;
}
.sync-state.failed {
  color: #87584e;
}
.sync-recording {
  padding: 5px 0;
  background: transparent;
  color: #73746e;
  font-size: 12px;
  letter-spacing: 0.01em;
  transition: color 0.15s ease;
}
.sync-recording span {
  display: inline-block;
  margin-right: 3px;
  font-size: 14px;
  line-height: 0;
}
.sync-recording:hover {
  color: #20211f;
}
.sync-recording:disabled {
  color: #92938d;
  cursor: default;
}
.machine-summary {
  color: #77776f;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.machine-list {
  display: grid;
  gap: 12px;
}
.machine-card {
  padding: 18px;
  border: 1px solid #d7d6cf;
  border-radius: 9px;
  background: #f3f2ed;
}
.machine-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.machine-identity {
  display: grid;
  gap: 8px;
  min-width: 0;
}
.machine-name {
  margin: 0;
  overflow: hidden;
  font-size: 16px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.machine-status {
  width: fit-content;
  padding: 3px 7px;
  border-radius: 10px;
  font-size: 11px;
}
.machine-status.online {
  background: #dce6d9;
  color: #40543d;
}
.machine-status.offline {
  background: #e5ded9;
  color: #704b41;
}
.machine-last-seen {
  color: #85857f;
  font-size: 12px;
  text-align: right;
  white-space: nowrap;
}
.machine-details {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 17px 24px;
  margin: 18px 0 0;
}
.machine-details > div {
  min-width: 0;
}
.machine-details dt {
  color: #85857f;
  font-size: 11px;
}
.machine-details dd {
  margin: 5px 0 0;
  overflow-wrap: anywhere;
  font-size: 13px;
}
.machine-displays {
  grid-column: span 2;
}
.machine-error {
  margin: 16px 0 0;
  padding-top: 12px;
  border-top: 1px solid #deddd6;
  color: #87584e;
  font-size: 12px;
  overflow-wrap: anywhere;
}
.machine-card-footer {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 14px;
}
.machine-update {
  padding: 6px 10px;
  font-size: 12px;
}
.machine-open {
  padding: 6px 0;
  background: transparent;
  color: #6f706a;
  font-size: 12px;
}
.machine-open:hover {
  color: #20211f;
  text-decoration: underline;
}
.library-empty {
  padding: 80px 0;
  color: #85857f;
  text-align: center;
}
.client-list {
  display: grid;
  gap: 10px;
}
.update-publisher {
  display: grid;
  gap: 14px;
  margin: 24px 0 30px;
  padding: 20px;
  border: 1px solid #d7d6cf;
  border-radius: 9px;
  background: #eeede7;
}
.update-publisher-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
}
.update-publisher h2 {
  margin: 5px 0 0;
  font-size: 20px;
}
.update-publisher-heading > span,
.update-publisher p,
.update-publisher output {
  color: #77776f;
  font-size: 12px;
}
.update-publisher p {
  margin: 0;
}
.update-publisher form {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(220px, 1fr) auto;
  align-items: end;
  gap: 14px;
}
.update-publisher label {
  display: grid;
  gap: 7px;
  color: #77776f;
  font-size: 12px;
}
.update-publisher input[type="file"] {
  min-width: 0;
  padding: 9px;
  border: 1px solid #cfcec7;
  border-radius: 7px;
  background: #f5f4ef;
}

.server-list-editor textarea {
  box-sizing: border-box;
  width: min(720px, 100%);
  min-height: 110px;
  resize: vertical;
  border: 1px solid #d9d9d2;
  border-radius: 8px;
  padding: 10px 12px;
  background: #fff;
  color: #20211f;
  font: 13px/1.55 ui-monospace, SFMono-Regular, Consolas, monospace;
}
.server-list-editor form {
  grid-template-columns: minmax(0, 1fr) auto;
}
.update-publisher button {
  padding: 11px 16px;
  border-radius: 7px;
  background: #272825;
  color: #f6f5f0;
}
.update-publisher button:disabled {
  opacity: 0.45;
  cursor: default;
}
.client-card {
  display: grid;
  grid-template-columns: minmax(220px, 1.5fr) minmax(180px, 1fr) auto;
  align-items: center;
  gap: 24px;
  padding: 17px 18px;
  border: 1px solid #d7d6cf;
  border-radius: 9px;
  background: #f3f2ed;
}
.client-identity,
.client-state {
  display: grid;
  gap: 5px;
  min-width: 0;
}
.client-name {
  font-size: 14px;
}
.client-package,
.client-state > span:last-child {
  color: #85857f;
  font-size: 11px;
}
.client-package {
  overflow: hidden;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.client-status {
  width: fit-content;
  padding: 3px 7px;
  border-radius: 10px;
  font-size: 11px;
}
.client-status.active {
  background: #dce6d9;
  color: #40543d;
}
.client-status.disabled {
  background: #e5ded9;
  color: #704b41;
}
.client-actions {
  display: flex;
  gap: 8px;
}
.client-actions button {
  padding: 8px 11px;
  border-radius: 7px;
  background: #deddd7;
}
.client-actions .danger {
  color: #713d31;
}
@media (max-width: 980px) {
  .recording-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .machine-details {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .machine-displays {
    grid-column: span 2;
  }
  .client-card {
    grid-template-columns: 1fr auto;
  }
  .update-publisher form {
    grid-template-columns: 1fr 1fr;
  }
  .update-publisher button {
    grid-column: 1 / -1;
  }
  .client-state {
    grid-column: 1;
  }
  .client-actions {
    grid-column: 2;
    grid-row: 1 / span 2;
  }
}
@media (max-width: 720px) {
  body {
    display: block;
  }
  aside {
    position: static;
    width: 100%;
    height: auto;
    padding: 14px 18px;
    flex-direction: row;
    align-items: center;
    gap: 12px;
  }
  .brand {
    margin: 0 auto 0 0;
    font-size: 14px;
  }
  nav {
    display: flex;
    flex-wrap: wrap;
  }
  .nav-item,
  .folder {
    width: auto;
    margin: 0;
    padding: 9px;
  }
  .folder {
    margin: 0;
  }
  main {
    padding: 28px 18px;
  }
  .settings {
    grid-template-columns: 1fr 1fr;
  }
  .recording-grid {
    grid-template-columns: 1fr;
  }
  .machine-card-header {
    display: grid;
  }
  .machine-last-seen {
    text-align: left;
  }
  .machine-details {
    grid-template-columns: 1fr;
  }
  .machine-displays {
    grid-column: auto;
  }
  .client-card {
    grid-template-columns: 1fr;
  }
  .update-publisher-heading,
  .update-publisher form {
    display: grid;
    grid-template-columns: 1fr;
  }
  .update-publisher button {
    grid-column: auto;
  }
  .client-state,
  .client-actions {
    grid-column: 1;
    grid-row: auto;
  }
  h1 {
    font-size: 31px;
  }
  .library-actions {
    gap: 10px;
    flex-wrap: wrap;
  }
  .clean-button {
    padding: 8px;
  }
}
