:root {
  color-scheme: dark;
  --bg: #060a14;
  --panel: rgba(16, 24, 39, 0.82);
  --panel-2: rgba(234, 242, 255, 0.075);
  --text: #eaf2ff;
  --muted: #b9c9e7;
  --line: rgba(234, 242, 255, 0.14);
  --accent: #63d5ff;
  --accent-2: #8b7cff;
  --warn: #f4c95d;
  --bad: #ff7676;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(135deg, #060a14 0%, #0c1628 46%, #101827 100%);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

.shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 40px;
  position: relative;
  z-index: 1;
}

.topbar,
.workspace,
.log-panel,
.status-band article {
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 8px;
  backdrop-filter: blur(18px);
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.28);
}

.topbar {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 18px;
  align-items: center;
  padding: 18px;
}

.mark {
  width: 56px;
  height: 56px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1,
h2 {
  margin-bottom: 8px;
  line-height: 1.1;
}

p {
  color: var(--muted);
  line-height: 1.6;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid var(--accent);
  border-radius: 8px;
  background: var(--accent);
  color: #06101c;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  transition: background 180ms ease, border-color 180ms ease, color 180ms ease, transform 180ms ease;
}

.button:hover {
  border-color: var(--accent-2);
  background: var(--accent-2);
  color: #ffffff;
}

.status-band {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 14px 0;
}

.status-band article {
  padding: 16px;
}

.status-band span {
  display: block;
  color: var(--muted);
  font-size: 0.9rem;
}

.status-band strong {
  display: block;
  margin-top: 6px;
  font-size: 1.1rem;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, 0.75fr);
  gap: 24px;
  align-items: start;
  padding: 24px;
  margin-top: 14px;
}

.product-panel h2 {
  max-width: 640px;
  font-size: clamp(2.1rem, 4.8vw, 4rem);
  letter-spacing: 0;
}

.side-copy {
  display: grid;
  align-content: start;
  gap: 8px;
}

.side-copy h3 {
  margin: 0;
  font-size: 1.35rem;
  line-height: 1.15;
}

.feature-list {
  display: grid;
  gap: 10px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}

.feature-list li {
  position: relative;
  padding-left: 24px;
  color: var(--muted);
  line-height: 1.5;
}

.feature-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.58em;
  width: 9px;
  height: 9px;
  border: 1px solid var(--accent);
  border-radius: 2px;
  background: rgba(99, 213, 255, 0.2);
  box-shadow: 0 0 18px rgba(99, 213, 255, 0.38);
  transform: rotate(12deg);
}

.device-form {
  display: grid;
  gap: 12px;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

input,
select {
  min-width: 0;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
  color: var(--text);
  font: inherit;
  padding: 0 12px;
}

select {
  appearance: none;
}

.secondary {
  background: transparent;
  color: var(--text);
}

.secondary:hover {
  background: rgba(139, 124, 255, 0.24);
}

.system-list,
.member-list,
.inventory-list {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.system-card,
.member-row,
.inventory-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
  padding: 14px;
}

.system-card {
  display: grid;
  gap: 10px;
}

.system-card h3,
.member-row strong {
  margin: 0;
  color: var(--text);
}

.system-card p,
.member-row span,
.inventory-card p {
  margin: 0;
  color: var(--muted);
}

.system-card__actions,
.member-row {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}

.member-row > div {
  min-width: 0;
}

.member-row span {
  word-break: break-word;
}

.inventory-summary {
  margin-top: 14px;
  color: var(--muted);
  font-weight: 700;
  line-height: 1.5;
}

.inventory-list {
  grid-column: 1 / -1;
}

.bulk-actions {
  grid-column: 1 / -1;
  display: flex;
  gap: 10px;
  align-items: end;
  flex-wrap: wrap;
  padding-top: 6px;
}

.bulk-user {
  min-width: min(100%, 280px);
}

.compact,
.bulk-actions .button {
  min-height: 36px;
  padding: 0 12px;
  font-size: 0.88rem;
}

.inventory-card {
  display: grid;
  grid-template-columns: 32px minmax(170px, 1.25fr) minmax(140px, 0.8fr) repeat(5, minmax(90px, 1fr)) minmax(84px, auto);
  gap: 10px 16px;
  align-items: center;
}

.inventory-card h3 {
  margin: 0 0 4px;
  color: var(--text);
}

.inventory-card > div:first-child p {
  word-break: break-all;
}

.inventory-card > p {
  word-break: break-word;
}

.inventory-check {
  display: flex;
  align-items: center;
  justify-content: center;
}

.inventory-check input[type="checkbox"] {
  width: 18px;
  height: 18px;
  min-height: 0;
  padding: 0;
  accent-color: var(--accent);
}

.inventory-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.inventory-actions {
  display: flex;
  justify-content: flex-end;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  color: var(--text);
  background: rgba(234, 242, 255, 0.08);
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: capitalize;
}

.status-connected {
  border-color: rgba(99, 213, 255, 0.62);
  color: #cbf5ff;
  background: rgba(99, 213, 255, 0.13);
}

.status-disconnected {
  border-color: rgba(255, 118, 118, 0.62);
  color: #ffd6d6;
  background: rgba(255, 118, 118, 0.12);
}

.status-unknown {
  border-color: rgba(244, 201, 93, 0.58);
  color: #ffe8aa;
  background: rgba(244, 201, 93, 0.12);
}

.inventory-empty {
  margin: 0;
}

.qr-video {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #000;
}

.inline-output {
  min-height: 44px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
  word-break: break-word;
}

.qr-preview {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.qr-preview svg {
  display: block;
  width: min(240px, 100%);
  height: auto;
}

.label-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.hidden {
  display: none;
}

.log-panel {
  margin-top: 14px;
  padding: 18px;
}

.site-footer {
  display: grid;
  justify-items: center;
  gap: 2px;
  width: 100%;
  margin: 18px auto 0;
  padding: 16px 0 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
  text-align: center;
  font-size: 0.78rem;
  line-height: 1.45;
}

.site-footer p {
  width: 100%;
  margin: 0;
  text-align: center;
}

.site-footer a {
  color: var(--text);
  text-decoration: none;
}

.site-footer a:hover,
.site-footer a:focus-visible {
  color: var(--accent);
}

pre {
  overflow: auto;
  min-height: 120px;
  margin: 0;
  white-space: pre-wrap;
  color: var(--muted);
}

@media (max-width: 760px) {
  .shell {
    width: min(100% - 20px, 1120px);
    padding-top: 10px;
  }

  .topbar,
  .workspace,
  .status-band,
  .inventory-card {
    grid-template-columns: 1fr;
  }

  .topbar {
    align-items: start;
  }

  .button {
    width: 100%;
  }
}
