:root {
  --bg: #0f1419;
  --panel: #171e26;
  --border: #2a3542;
  --text: #e6edf3;
  --dim: #8b98a5;
  --green: #3fb950;
  --blue: #58a6ff;
  --orange: #f0883e;
  --red: #f85149;
  --mono: ui-monospace, "Cascadia Code", "JetBrains Mono", Consolas, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  min-height: 100vh;
}
[hidden] { display: none !important; }

button {
  font: inherit; font-size: 14px; cursor: pointer;
  background: var(--panel); color: var(--text);
  border: 1px solid var(--border); border-radius: 8px; padding: 8px 14px;
}
button:hover { border-color: var(--dim); }
button.danger { color: var(--red); }
button.primary { background: var(--green); color: #0b0f14; border: 0; font-weight: 600; }

input, textarea {
  font: inherit; color: var(--text); background: var(--panel);
  border: 1px solid var(--border); border-radius: 8px; padding: 9px 12px;
}
input:focus, textarea:focus { outline: 2px solid var(--blue); border-color: transparent; }

.request { font-family: var(--mono); color: var(--dim); font-size: 14px; }
.request b { color: var(--green); font-weight: 600; }

.connection { font-family: var(--mono); font-size: 13px; color: var(--dim); }
.connection::before {
  content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  margin-right: 6px; background: var(--red); vertical-align: 1px;
}
.connection.on::before { background: var(--green); }

/* ---------- the shared board ---------- */
.grid {
  display: grid; gap: 18px; align-items: start;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}
.window {
  background: #fff; border-radius: 10px; overflow: hidden;
  box-shadow: 0 6px 24px rgba(0,0,0,.35);
  position: relative;
}
.window.new { animation: enter .45s ease-out; }
.window.flash { animation: flash .6s ease-out; }
@keyframes enter { from { opacity: 0; transform: translateY(14px) scale(.97); } }
@keyframes flash { from { box-shadow: 0 0 0 3px var(--blue), 0 6px 24px rgba(0,0,0,.35); } }
.bar {
  display: flex; align-items: center; gap: 6px;
  background: #e8eaed; padding: 7px 10px; border-bottom: 1px solid #d0d4d9;
}
.dot { width: 10px; height: 10px; border-radius: 50%; background: #ff5f57; }
.dot:nth-child(2) { background: #febc2e; }
.dot:nth-child(3) { background: #28c840; }
.tab {
  margin-left: 8px; font-family: var(--mono); font-size: 12px; color: #3c4043;
  background: #fff; padding: 2px 10px; border-radius: 6px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 70%;
}
.window iframe { display: block; width: 100%; height: 160px; border: 0; background: #fff; }
.window .close {
  position: absolute; top: 3px; right: 6px; padding: 2px 8px; font-size: 13px;
  background: transparent; border: 0; color: #5f6368;
}
.window .close:hover { color: var(--red); }
.empty {
  grid-column: 1 / -1; text-align: center; color: var(--dim);
  padding: 50px 20px; border: 2px dashed var(--border); border-radius: 16px;
}
.empty .big { font-family: var(--mono); font-size: 36px; color: var(--text); }
.message { font-family: var(--mono); font-size: 14px; min-height: 1.4em; }
.message.error { color: var(--red); }
.message.ok { color: var(--green); }
