:root {
  --bg: #06131a;
  --panel: rgba(9, 20, 29, 0.58);
  --panel-strong: rgba(8, 18, 26, 0.78);
  --line: rgba(194, 235, 255, 0.16);
  --text: #edf7fb;
  --muted: #8caab8;
  --accent: #66d9ff;
  --accent-2: #9dffca;
  --danger: #ff7b87;
  --shadow: 0 28px 60px rgba(0, 0, 0, 0.38);
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
}

body {
  overflow: hidden;
  background:
    radial-gradient(circle at top left, rgba(73, 148, 177, 0.15), transparent 26%),
    linear-gradient(135deg, #07131b 0%, #081821 45%, #03080d 100%);
  color: var(--text);
  font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 390px;
  width: 100vw;
  height: 100vh;
  padding: 14px;
  gap: 14px;
}

.camera-stage {
  position: relative;
  min-width: 0;
  border-radius: 30px;
  overflow: hidden;
  background: #000;
  box-shadow: var(--shadow);
}

#stream {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  filter: saturate(1.06) contrast(1.04);
  background: #000;
}

.camera-vignette {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(4, 13, 20, 0.55) 0%, rgba(4, 13, 20, 0.02) 35%, rgba(4, 13, 20, 0.1) 58%, rgba(4, 13, 20, 0.75) 100%),
    radial-gradient(circle at 20% 20%, rgba(0, 0, 0, 0.05), transparent 40%);
  pointer-events: none;
}

.glass {
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  background: var(--panel);
  border: 1px solid var(--line);
}

.camera-topbar,
.camera-footer,
.camera-session {
  position: absolute;
  left: 14px;
  border-radius: 18px;
}

.camera-topbar,
.camera-footer {
  right: 14px;
}

.camera-topbar {
  top: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
}

.camera-footer {
  bottom: 14px;
  display: grid;
  grid-template-columns: 120px 1fr 170px;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
}

.camera-session {
  top: 96px;
  width: min(360px, calc(100% - 28px));
  padding: 12px 14px;
  background: rgba(9, 20, 29, 0.44);
  border: 1px solid rgba(194, 235, 255, 0.14);
}

.eyebrow {
  margin: 0 0 6px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 11px;
  color: var(--muted);
}

h1 {
  margin: 0;
  font-size: 18px;
  line-height: 1.06;
  max-width: 620px;
}

.status-pill {
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  background: rgba(102, 217, 255, 0.15);
  border: 1px solid rgba(102, 217, 255, 0.24);
}

.status-pill.printing {
  background: rgba(157, 255, 202, 0.16);
  border-color: rgba(157, 255, 202, 0.28);
  color: #dbffe7;
}

.status-pill.offline,
.status-pill.error {
  background: rgba(255, 123, 135, 0.16);
  border-color: rgba(255, 123, 135, 0.28);
  color: #ffe2e7;
}

.metric {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.metric.compact {
  align-items: flex-end;
  text-align: right;
}

.label {
  display: block;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  margin-bottom: 6px;
}

.metric strong,
.hero-grid strong,
.info-grid strong {
  font-size: 17px;
  font-weight: 700;
}

.progress-track {
  width: 100%;
  height: 16px;
  padding: 3px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.progress-bar {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 30px rgba(102, 217, 255, 0.45);
  transition: width 0.5s ease;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.card {
  border-radius: 18px;
  padding: 12px 12px 14px;
  box-shadow: var(--shadow);
}

.hero {
  background:
    linear-gradient(160deg, rgba(11, 28, 40, 0.75), rgba(6, 15, 23, 0.9)),
    radial-gradient(circle at top right, rgba(102, 217, 255, 0.2), transparent 30%);
}

.hero-grid,
.info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 10px;
}

.camera-session .hero-grid strong {
  font-size: 16px;
}

.camera-session .label,
.camera-session .eyebrow {
  font-size: 10px;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.swatch {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.55);
  background: rgba(255, 255, 255, 0.18);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.12);
}

.types-card {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.type-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow: auto;
  padding-right: 4px;
}

.type-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.type-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 11px;
}

.sidebar .eyebrow {
  font-size: 10px;
  letter-spacing: 0.16em;
}

.sidebar .label {
  font-size: 10px;
  letter-spacing: 0.1em;
  margin-bottom: 4px;
}

.type-name {
  color: var(--text);
}

.type-count {
  color: var(--muted);
}

.type-bar-track {
  width: 100%;
  height: 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.type-bar-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(102, 217, 255, 0.88), rgba(157, 255, 202, 0.95));
}

@media (max-width: 1500px) {
  .layout {
    grid-template-columns: minmax(0, 1fr) 350px;
  }

  .camera-footer {
    grid-template-columns: 110px 1fr 150px;
  }
}
