
:root {
  color-scheme: dark;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: #edf4fb;
  background: #0a1019;
  --muted: #9daec0;
  --accent: #86e7d0;
  --line: #263546;
  --panel: #121d2b;
  --inset: #0c1622;
  --mono: "SF Mono", "Menlo", monospace;
}
*, *::before, *::after {
  box-sizing: border-box;
}
body {
  margin: 0;
  min-width: 300px;
  min-height: 100vh;
  background: radial-gradient(ellipse at 18% 0%, #132b38 0%, #0a1019 55%);
}
main {
  max-width: 1060px;
  margin: 0 auto;
  padding: clamp(22px, 5vw, 60px) clamp(16px, 4vw, 30px);
}
.mast, .card, .console, button, input, .state, .port {
  corner-shape: squircle;
}
.mast {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 24px;
  padding: clamp(22px, 4vw, 36px);
  border: 1px solid #2b4553;
  border-radius: 32px;
  background: linear-gradient(120deg, #142b38, #101c2a 84%);
  box-shadow: 0 18px 45px #0003;
}
.eyebrow {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: .83rem;
  letter-spacing: .1em;
  font-weight: 650;
}
h1, h2, p { margin: 0; }
h1 {
  font-size: clamp(1.7rem, 4vw, 2.35rem);
  line-height: 1.2;
  letter-spacing: -.035em;
}
h2 { font-size: 1.08rem; line-height: 1.4; }
.details, .help { color: var(--muted); font-size: .88rem; line-height: 1.65; }
.details { margin-top: 10px; }
.connection {
  display: grid;
  gap: 10px;
  min-width: min(100%, 180px);
  justify-items: start;
}
.state {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 8px 13px;
  border-radius: 13px;
  border: 1px solid #355062;
  background: #142535;
  color: #c1d1df;
  font-size: .85rem;
  font-weight: 650;
}
.state::before {
  content: "";
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}
.state[data-state="ready"] { color: var(--accent); }
.state[data-state="working"] { color: #ffda96; }
.state[data-state="error"] { color: #ffaaa9; }
#device-name { overflow-wrap: anywhere; }
.grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
  margin-top: 16px;
}
.card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: clamp(17px, 3vw, 24px);
  border-radius: 24px;
  border: 1px solid var(--line);
  background: var(--panel);
  min-width: 0;
}
.card-head, .actions, .input-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}
.card-head { justify-content: space-between; }
.port {
  padding: 5px 10px;
  border-radius: 9px;
  background: #1e3042;
  color: #b1cfe5;
  font: .83rem var(--mono);
}
form { display: grid; gap: 9px; }
label { color: #c9d6e3; font-size: .86rem; font-weight: 600; }
input {
  width: 100%;
  min-width: 0;
  min-height: 46px;
  padding: 11px 13px;
  border: 1px solid #31485c;
  border-radius: 12px;
  background: var(--inset);
  color: #edf4fb;
  font: .89rem var(--mono);
}
input::placeholder { color: #8298ae; opacity: 1; }
.input-row input { flex: 1 1 160px; }
button {
  min-height: 42px;
  padding: 9px 13px;
  border: 1px solid #3b5265;
  border-radius: 12px;
  background: #213247;
  color: #e8f3fb;
  font-family: inherit;
  font-size: .875rem;
  font-weight: 650;
  cursor: pointer;
}
button.primary {
  color: #102821;
  border-color: #92f1dc;
  background: var(--accent);
}
button:enabled:hover { filter: brightness(1.12); }
button:active { filter: brightness(.92); }
button:disabled { opacity: .47; cursor: default; }
:where(button,input,a):focus-visible {
  outline: 2px solid #a7f5de;
  outline-offset: 3px;
}
.card > .actions { margin-top: auto; }
.log-card { grid-column: 1 / -1; }
.console {
  min-height: 200px;
  height: clamp(210px, 28vh, 340px);
  overflow: auto;
  overscroll-behavior: contain;
  border: 1px solid #2a3c4f;
  border-radius: 15px;
  padding: 13px 15px;
  background: #090f18;
  color: #cddeec;
  font: .83rem/1.65 var(--mono);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.log-line + .log-line { margin-top: 3px; }
.log-line time { color: #91a6bb; margin-inline-end: .7rem; }
.log-line[data-level="error"] { color: #ffaaa9; }
.log-line[data-level="success"] { color: var(--accent); }
@media (max-width: 680px) {
  .grid { grid-template-columns: minmax(0, 1fr); }
}
