/* DS Connect – Digitalschmiede.tech Designsystem (gemeinsam für Viewer und Host) */
:root {
  --bg: #0d0f12;
  --bg-2: #14171c;
  --surface: #1a1e24;
  --surface-2: #222731;
  --line: #2c323d;
  --text: #eef0f3;
  --text-2: #a4acb9;
  --text-3: #6d7584;
  --accent: #ff6a2b;        /* Schmiedeglut */
  --accent-2: #ffb347;
  --accent-ink: #1a0d05;
  --ok: #3ecf8e;
  --warn: #f5b942;
  --danger: #ef5b5b;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 20px 50px -20px rgba(0, 0, 0, .6);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Consolas, monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  background-image:
    radial-gradient(900px 500px at 85% -10%, rgba(255, 106, 43, .10), transparent 60%),
    radial-gradient(700px 400px at -10% 110%, rgba(255, 179, 71, .06), transparent 60%);
  color: var(--text);
  font: 15px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
}
button, input, textarea, select { font: inherit; color: inherit; }
.hidden { display: none !important; }

/* ---------- Kopfzeile ---------- */
.topbar {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 24px; border-bottom: 1px solid var(--line);
  background: rgba(13, 15, 18, .7); backdrop-filter: blur(10px);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: -.01em; }
.brand .mark { width: 30px; height: 30px; }
.brand small { display: block; font-weight: 500; color: var(--text-3); font-size: 12px; letter-spacing: .02em; }
.topbar .spacer { flex: 1; }
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 999px; font-size: 12.5px;
  background: var(--surface); border: 1px solid var(--line); color: var(--text-2);
}
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-3); }
.dot.ok { background: var(--ok); box-shadow: 0 0 0 3px rgba(62, 207, 142, .18); }
.dot.warn { background: var(--warn); }
.dot.err { background: var(--danger); }

/* ---------- Layout ---------- */
.wrap { max-width: 1040px; margin: 0 auto; padding: 40px 24px 60px; }
.hero h1 { font-size: clamp(26px, 4vw, 38px); line-height: 1.15; margin: 0 0 8px; letter-spacing: -.02em; }
.hero p { color: var(--text-2); margin: 0 0 28px; max-width: 60ch; }
.grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 20px; }
@media (max-width: 820px) { .grid { grid-template-columns: 1fr; } }

.card {
  background: linear-gradient(180deg, var(--surface), var(--bg-2));
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px; box-shadow: var(--shadow);
}
.card h2 { font-size: 15px; margin: 0 0 16px; color: var(--text-2); font-weight: 600; text-transform: uppercase; letter-spacing: .08em; }
.card + .card { margin-top: 20px; }

/* ---------- Formulare ---------- */
label.field { display: block; margin-bottom: 14px; }
label.field span { display: block; font-size: 13px; color: var(--text-2); margin-bottom: 6px; }
.input {
  width: 100%; padding: 12px 14px; border-radius: var(--radius-sm);
  background: var(--bg); border: 1px solid var(--line); outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(255, 106, 43, .18); }
.input.big { font: 600 26px/1.2 var(--mono); letter-spacing: .08em; padding: 14px 16px; }
.row { display: flex; gap: 12px; }
.row > * { flex: 1; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 18px; border-radius: var(--radius-sm); border: 1px solid var(--line);
  background: var(--surface-2); cursor: pointer; font-weight: 600;
  transition: transform .06s, background .15s, border-color .15s;
}
.btn:hover { border-color: #3a4250; background: #262c37; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: var(--accent-ink); border: 0; }
.btn.primary:hover { filter: brightness(1.06); }
.btn.danger { background: rgba(239, 91, 91, .12); border-color: rgba(239, 91, 91, .4); color: #ffb1b1; }
.btn.ghost { background: transparent; }
.btn.block { width: 100%; padding: 14px; font-size: 16px; }
.btn.sm { padding: 7px 11px; font-size: 13px; }
.btn svg { width: 18px; height: 18px; }

.msg { margin-top: 12px; font-size: 14px; min-height: 20px; }
.msg.err { color: #ff9a9a; }
.msg.info { color: var(--text-2); }

/* ---------- Listen ---------- */
.list { list-style: none; margin: 0; padding: 0; }
.list li {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: var(--radius-sm); margin-bottom: 8px;
  background: var(--bg); cursor: pointer;
}
.list li:hover { border-color: var(--accent); }
.list .mono { font-family: var(--mono); font-weight: 600; }
.list .sub { color: var(--text-3); font-size: 12.5px; }
.list .grow { flex: 1; min-width: 0; }
.empty { color: var(--text-3); font-size: 14px; }
.steps { margin: 0; padding-left: 18px; color: var(--text-2); }
.steps li { margin-bottom: 6px; }
a { color: var(--accent-2); }

/* ---------- Warte-Overlay ---------- */
.overlay {
  position: fixed; inset: 0; display: grid; place-items: center; z-index: 50;
  background: rgba(8, 9, 11, .78); backdrop-filter: blur(6px);
}
.overlay .card { width: min(440px, calc(100vw - 32px)); text-align: center; }
.spinner {
  width: 46px; height: 46px; margin: 4px auto 16px; border-radius: 50%;
  border: 3px solid var(--line); border-top-color: var(--accent); animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Sitzung ---------- */
.session { position: fixed; inset: 0; display: flex; flex-direction: column; background: #050607; z-index: 40; }
.toolbar {
  display: flex; align-items: center; gap: 8px; padding: 8px 12px;
  background: var(--bg-2); border-bottom: 1px solid var(--line); flex-wrap: wrap;
}
.toolbar .title { font-weight: 600; margin-right: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 30vw; }
.toolbar .spacer { flex: 1; }
.toolbar select { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 6px 8px; }
.btn.on { border-color: var(--accent); color: var(--accent-2); }
.stage { position: relative; flex: 1; display: flex; min-height: 0; }
.screen { flex: 1; position: relative; overflow: auto; outline: none; display: grid; place-items: center; }
.screen video { max-width: 100%; max-height: 100%; width: 100%; height: 100%; object-fit: contain; background: #000; cursor: default; }
.screen.native { place-items: start; }
.screen.native video { width: auto; height: auto; max-width: none; max-height: none; }
.screen.control video { cursor: crosshair; }
.screen:focus-visible { box-shadow: inset 0 0 0 2px var(--accent); }
.stats { font: 12px var(--mono); color: var(--text-3); white-space: nowrap; }

.chat {
  width: 320px; border-left: 1px solid var(--line); background: var(--bg-2);
  display: flex; flex-direction: column;
}
.chat header { padding: 12px 14px; border-bottom: 1px solid var(--line); font-weight: 600; display: flex; justify-content: space-between; align-items: center; }
.chat .log { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.bubble { max-width: 85%; padding: 8px 11px; border-radius: 12px; background: var(--surface-2); white-space: pre-wrap; word-break: break-word; font-size: 14px; }
.bubble.me { align-self: flex-end; background: rgba(255, 106, 43, .16); border: 1px solid rgba(255, 106, 43, .35); }
.bubble.sys { align-self: center; background: transparent; color: var(--text-3); font-size: 12.5px; }
.chat form { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--line); }
.chat form .input { padding: 9px 11px; }
.badge { background: var(--accent); color: var(--accent-ink); border-radius: 999px; font-size: 11px; padding: 0 6px; font-weight: 700; margin-left: 4px; }

.toast {
  position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 100;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 10px 16px; box-shadow: var(--shadow); font-size: 14px;
}
footer.foot { text-align: center; color: var(--text-3); font-size: 12.5px; padding: 24px; }
