:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f5f7f3;
  color: #17211b;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
}

button,
input {
  font: inherit;
}

button {
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  padding: 0 18px;
  background: #1967d2;
  color: #fff;
  font-weight: 700;
}

button:disabled {
  opacity: 0.45;
}

.secondary {
  border: 1px solid #c7d0c8;
  background: #fff;
  color: #17211b;
}

.shell {
  min-height: 100vh;
}

.hidden {
  display: none !important;
}

.login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.panel {
  width: min(420px, 100%);
  display: grid;
  gap: 18px;
  padding: 28px;
  border: 1px solid #dbe3dc;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 18px 48px rgb(17 24 39 / 10%);
}

.eyebrow {
  margin: 0 0 6px;
  color: #5a6b60;
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0;
}

h1 {
  margin: 0;
  font-size: 28px;
  line-height: 1.15;
}

label {
  display: grid;
  gap: 7px;
  color: #314037;
  font-weight: 700;
}

input {
  width: 100%;
  min-height: 46px;
  border: 1px solid #c8d3ca;
  border-radius: 8px;
  padding: 0 13px;
  background: #fff;
  color: #17211b;
}

.error {
  min-height: 20px;
  margin: 0;
  color: #b42318;
  font-weight: 700;
}

.app {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr;
}

.topbar {
  min-height: 78px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 22px;
  border-bottom: 1px solid #dbe3dc;
  background: #fff;
}

.workspace {
  min-height: 0;
  display: grid;
  grid-template-columns: 290px 1fr;
}

.devices {
  border-right: 1px solid #dbe3dc;
  background: #fbfcfa;
  padding: 16px;
}

.sectionTitle {
  margin-bottom: 12px;
  color: #5a6b60;
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

.devicesList {
  display: grid;
  gap: 8px;
}

.deviceButton {
  width: 100%;
  min-height: 68px;
  display: grid;
  gap: 4px;
  justify-items: start;
  border: 1px solid #d5ded7;
  background: #fff;
  color: #17211b;
  text-align: left;
}

.deviceButton.active {
  border-color: #1967d2;
  box-shadow: inset 3px 0 0 #1967d2;
}

.deviceName {
  font-weight: 800;
}

.deviceMeta {
  color: #647169;
  font-size: 13px;
  font-weight: 600;
}

.viewer {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: auto 1fr auto;
}

.viewerToolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 18px;
  border-bottom: 1px solid #dbe3dc;
  background: #fff;
}

.selectedName {
  font-size: 18px;
  font-weight: 850;
}

.statusText {
  margin-top: 3px;
  color: #647169;
  font-size: 13px;
  font-weight: 650;
}

.actions {
  display: flex;
  gap: 8px;
}

.screenWrap {
  position: relative;
  min-height: 360px;
  overflow: auto;
  display: grid;
  place-items: center;
  background: #202124;
  touch-action: none;
}

#screenImage {
  display: none;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  user-select: none;
  -webkit-user-select: none;
}

.emptyState {
  color: #dfe7e1;
  font-weight: 750;
}

.textForm {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  padding: 14px 18px;
  border-top: 1px solid #dbe3dc;
  background: #fff;
}

@media (max-width: 760px) {
  .topbar {
    align-items: flex-start;
  }

  .workspace {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
  }

  .devices {
    border-right: 0;
    border-bottom: 1px solid #dbe3dc;
  }

  .devicesList {
    grid-auto-flow: column;
    grid-auto-columns: minmax(210px, 1fr);
    overflow-x: auto;
  }

  .viewerToolbar,
  .textForm {
    grid-template-columns: 1fr;
  }

  .viewerToolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .screenWrap {
    min-height: 52vh;
  }
}
