:root {
  --bg: #0b1020;
  --text: #e9eefc;
  --muted: #a9b4d6;
  --border: rgba(255,255,255,0.12);
  --shadow: 0 10px 30px rgba(0,0,0,0.35);
  --radius: 16px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
  color: var(--text);
  background: radial-gradient(1200px 800px at 10% 0%, #1b2a68 0%, var(--bg) 55%);
}

code, pre { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  background: rgba(11, 16, 32, 0.8);
  backdrop-filter: blur(10px);
}

.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.logo {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  background: rgba(255,255,255,0.08);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
}
.title { font-weight: 700; line-height: 1.1; }
.subtitle { color: var(--muted); font-size: 0.9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.actions { display: flex; gap: 10px; }
button {
  appearance: none;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 10px 14px;
  font-weight: 650;
  color: var(--text);
  background: rgba(255,255,255,0.06);
}
button.primary { background: rgba(124, 92, 255, 0.22); border-color: rgba(124, 92, 255, 0.55); }
button.secondary { background: rgba(255,255,255,0.05); }
button:disabled { opacity: 0.5; }

.wrap {
  max-width: 980px;
  margin: 18px auto 34px;
  padding: 0 16px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.card {
  background: linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.02));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
}

h2 { margin: 4px 0 12px; font-size: 1.1rem; }

.status {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.95rem;
  margin-bottom: 12px;
}
.small { font-size: 0.9rem; color: rgba(233,238,252,0.75); }

.dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.18);
  border: 1px solid var(--border);
  margin-right: 8px;
  vertical-align: middle;
}
.dot.ok { background: rgba(47, 212, 126, 0.95); border-color: rgba(47, 212, 126, 0.35); }
.dot.warn { background: rgba(255, 196, 0, 0.95); border-color: rgba(255, 196, 0, 0.35); }
.dot.bad { background: rgba(255, 90, 90, 0.95); border-color: rgba(255, 90, 90, 0.35); }

.preview {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 4;
  max-height: 68vh;
  overflow: hidden;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: rgba(0,0,0,0.25);
}

.preview video,
.preview canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1);
}

.output { margin-top: 12px; }
.label { color: var(--muted); font-size: 0.95rem; margin-bottom: 6px; }
pre#faceId {
  margin: 0;
  padding: 10px 12px;
  background: rgba(0,0,0,0.28);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: auto;
  font-size: 0.9rem;
  line-height: 1.25;
}
.meta { margin-top: 8px; color: rgba(233,238,252,0.8); font-size: 0.92rem; }

@media (min-width: 900px) {
  .wrap { grid-template-columns: 1.25fr 0.75fr; align-items: start; }
}