:root {
  font-family: Inter, "Segoe UI", "Microsoft YaHei", sans-serif;
  color: #19343e;
  background: #eef3f4;
  font-size: 14px;
  --line: #b6cbd0;
  --green: #087b6e;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
select {
  font: inherit;
}
button,
.file-button {
  border: 1px solid #9db7c0;
  border-radius: 9px;
  background: white;
  color: #234a56;
  padding: 11px 15px;
  cursor: pointer;
  font-weight: 600;
  min-height: 42px;
}
button:disabled {
  opacity: 0.45;
  cursor: default;
}
button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid #36b3a6;
  outline-offset: 2px;
}
.primary {
  background: var(--green);
  border-color: var(--green);
  color: white;
}
.subtle {
  background: #f4f8f8;
}
label {
  display: grid;
  gap: 8px;
  font-size: 12px;
  color: #415f69;
}
input,
select {
  width: 100%;
  min-width: 0;
  background: white;
  border: 1px solid #9bb8c1;
  border-radius: 8px;
  padding: 11px;
  color: #193f4c;
  font-size: 16px;
}
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px clamp(16px, 4vw, 55px);
  border-bottom: 1px solid var(--line);
  background: #fff;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  background: #e0f2ed;
  border: 1px solid #a3d4c7;
  border-radius: 12px;
  font-weight: 700;
  color: var(--green);
  font-size: 20px;
}
.brand small {
  display: block;
  margin-top: 3px;
  color: #5b737b;
  font-size: 11px;
}
.tabs {
  display: flex;
  gap: 8px;
  padding: 18px clamp(16px, 4vw, 55px) 0;
}
.tabs button {
  background: transparent;
  border-color: transparent;
  color: #536d77;
}
.tabs button.active {
  background: white;
  border-color: var(--line);
  color: #087264;
  box-shadow: 0 3px 12px #193e4810;
}
main {
  padding: 24px clamp(16px, 4vw, 55px) 35px;
  max-width: 1600px;
  margin: auto;
}
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 18px;
}
.section-head h1 {
  margin: 4px 0 0;
  font-size: 27px;
  letter-spacing: -0.7px;
}
.section-head h2 {
  font-size: 18px;
}
.eyebrow {
  font-size: 10px;
  letter-spacing: 2px;
  color: #387c79;
  margin: 0 0 6px;
}
.card {
  border: 1px solid var(--line);
  background: white;
  padding: 20px;
  border-radius: 13px;
  margin-bottom: 20px;
  box-shadow: 0 4px 13px #173c4910;
  min-width: 0;
}
.options {
  display: flex;
  gap: 10px;
  align-items: end;
  flex-wrap: wrap;
}
.options label {
  flex: 1;
  min-width: 75px;
}
.options button {
  margin-left: auto;
}
.wall-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(var(--columns, 2), minmax(0, 1fr));
}
.tile {
  border: 1px solid var(--line);
  background: white;
  border-radius: 10px;
  overflow: hidden;
  min-width: 0;
}
.tile-head {
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: space-between;
  font-size: 12px;
}
.tile-head strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.status {
  font-size: 10px;
  color: #6f8187;
  white-space: nowrap;
}
.status.online {
  color: #087967;
}
.picture {
  display: block;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: #e0e9ec;
  width: 100%;
  aspect-ratio: 16/9;
  min-height: 0;
  overflow: hidden;
  color: #607c85;
  font-size: 12px;
}
.picture img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.tile-foot {
  padding: 10px 12px;
  color: #4a6871;
  font-size: 12px;
  display: flex;
  gap: 6px;
  align-items: center;
}
.tile-foot span {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  flex: 1;
}
.tile-foot button {
  padding: 4px 7px;
  font-size: 11px;
  min-height: 30px;
}
.pager {
  display: flex;
  justify-content: center;
  gap: 14px;
  align-items: center;
  margin-top: 20px;
  font-size: 12px;
}
.pager button {
  font-size: 12px;
}
.hint {
  color: #5a747f;
  line-height: 1.9;
  font-size: 12px;
}
.send-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 15px 0;
}
.file-button {
  display: inline-flex;
  align-items: center;
  font-size: 14px;
}
.file-button input {
  display: none;
}
progress {
  width: 100%;
  height: 10px;
  accent-color: var(--green);
  margin: 15px 0 4px;
}
.transfer {
  padding: 20px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 12px;
  margin-bottom: 12px;
}
.transfer strong,
.transfer p {
  overflow-wrap: anywhere;
}
.transfer small {
  color: #56717b;
}
.transfer p {
  font-size: 12px;
  color: #45616b;
}
.transfer-actions {
  display: flex;
  gap: 9px;
  flex-wrap: wrap;
}
.transfer-actions button {
  font-size: 12px;
  padding: 8px 11px;
}
.danger {
  color: #b33e46;
  border-color: #d8a1a8;
}
footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  border-top: 1px solid var(--line);
  padding: 20px clamp(16px, 4vw, 55px);
  color: #54717a;
  font-size: 10px;
}
#announcement {
  padding: 12px 20px;
  background: #dcf0e9;
  text-align: center;
  color: #186752;
  font-size: 12px;
  white-space: pre-wrap;
}
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  max-width: 90%;
  border-radius: 10px;
  padding: 15px 22px;
  background: #264952;
  color: white;
  z-index: 100;
  overflow-wrap: anywhere;
  box-shadow: 0 10px 35px #1238;
}
#login {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  background:
    radial-gradient(ellipse at 12% 12%, #cdece1, transparent 60%), #edf3f4;
  padding: 24px;
}
.login-card {
  width: 420px;
  max-width: 100%;
  background: #ffffffee;
  padding: 35px;
  border: 1px solid #b9cfd0;
  border-radius: 20px;
  box-shadow: 0 24px 80px #1f5b6020;
}
.login-card h1 {
  font-size: 25px;
  margin: 14px 0;
}
.login-card p {
  color: #56737b;
  line-height: 1.8;
}
.login-card label {
  margin: 18px 0;
}
.login-card button {
  width: 100%;
  margin-top: 10px;
}
.login-card .eyebrow {
  margin: 24px 0 0;
}
.login-card small {
  font-size: 11px;
  color: #5b747f;
}
.error {
  color: #b63843 !important;
}
.toast[hidden],
[hidden] {
  display: none !important;
}
dialog {
  border: 1px solid #3b5964;
  border-radius: 12px;
  background: #10282f;
  padding: 12px;
  max-width: 98vw;
  max-height: 96dvh;
  width: 1200px;
  color: white;
}
dialog::backdrop {
  background: #0b202be6;
}
dialog img {
  display: block;
  width: 100%;
  max-height: 82dvh;
  object-fit: contain;
}
dialog button {
  display: block;
  margin: 0 0 10px auto;
  background: #26434d;
  color: white;
}
#wall-shell:fullscreen,
.wall-expanded {
  background: #071c23;
  padding: 0;
  display: flex;
  flex-direction: column;
  height: 100dvh;
  position: fixed;
  inset: 0;
  z-index: 80;
}
#wall-shell:fullscreen .wall-grid,
.wall-expanded .wall-grid {
  gap: 1px;
  flex: 1;
  min-height: 0;
  grid-template-rows: repeat(var(--rows, 2), minmax(0, 1fr));
}
#wall-shell:fullscreen .tile,
.wall-expanded .tile {
  border: 0;
  border-radius: 0;
  position: relative;
  display: flex;
  min-height: 0;
}
#wall-shell:fullscreen .picture,
.wall-expanded .picture {
  height: 100%;
  aspect-ratio: auto;
  background: #0d242d;
}
#wall-shell:fullscreen .tile-head,
.wall-expanded .tile-head {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  background: #0e2938aa;
  color: white;
  z-index: 2;
  padding: 6px;
  font-size: 11px;
}
#wall-shell:fullscreen .tile-foot,
.wall-expanded .tile-foot {
  display: none;
}
#wall-shell:fullscreen .pager,
.wall-expanded .pager {
  margin: 0;
  padding: 6px;
  color: white;
  font-size: 11px;
  gap: 8px;
}
#wall-shell:fullscreen .pager button,
.wall-expanded .pager button {
  padding: 5px 9px;
  min-height: 30px;
  background: #173944;
  color: #fff;
  border-color: #41616b;
}
#device-count {
  font-size: 12px;
  vertical-align: middle;
  margin-left: 10px;
  color: #52747c;
}
@media (max-width: 600px) {
  header {
    padding: 15px 16px;
  }
  .tabs {
    padding: 14px 16px 0;
  }
  main {
    padding: 22px 14px;
  }
  .section-head h1 {
    font-size: 23px;
  }
  .card {
    padding: 16px;
  }
  .wall-grid {
    gap: 8px;
  }
  .tile-head {
    padding: 9px 8px;
    gap: 3px;
  }
  .tile-head strong {
    font-size: 11px;
  }
  .tile-foot {
    padding: 8px;
    font-size: 10px;
    flex-wrap: wrap;
  }
  .tile-foot span {
    flex-basis: 100%;
  }
  .tile-foot button {
    font-size: 10px;
  }
  .picture {
    font-size: 10px;
  }
  .options {
    gap: 10px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .options label {
    min-width: 0;
    font-size: 10px;
  }
  .options input,
  .options select {
    padding: 9px;
  }
  .options button {
    width: 100%;
    padding: 9px;
  }
  .send-actions > * {
    flex: 1;
    justify-content: center;
    white-space: nowrap;
    padding: 10px;
    font-size: 12px;
  }
  .login-card {
    padding: 28px 22px;
  }
  .login-card h1 {
    font-size: 22px;
  }
  .transfer {
    padding: 16px;
  }
  .hint {
    font-size: 11px;
  }
  .pager {
    gap: 10px;
  }
  .pager button {
    padding: 9px 12px;
  }
}

.file-device-create summary {
  cursor: pointer;
  font-weight: 600;
  color: #116e65;
}
.file-device-create form {
  display: grid;
  gap: 14px;
  margin: 18px 0;
}
.file-device-create button {
  justify-self: start;
}
.agent-download {
  color: #087467;
  font-size: 12px;
  line-height: 1.7;
}
.file-device-create #file-binding {
  padding: 16px 0;
  border-top: 1px solid #c0d4d9;
}

#channel-dialog {
  width: min(560px, calc(100vw - 24px));
  max-height: calc(100dvh - 24px);
  box-sizing: border-box;
  background: #fff;
  color: #223c4b;
  border: 1px solid #a6bcc4;
  border-radius: 16px;
  padding: 18px;
}
#channel-dialog label {
  color: #294958;
}
#channel-dialog p {
  font-size: 13px;
  line-height: 1.8;
  color: #43616d;
}
#channel-dialog form {
  display: grid;
  gap: 12px;
}
#channel-dialog button {
  float: none;
  justify-self: start;
}
#channel-close {
  display: block;
  margin-left: auto;
}
#channel-dialog hr {
  margin: 22px 0;
  border: 0;
  border-top: 1px solid #c9d8dc;
}
#channel-dialog .error {
  color: #a83d42;
}
