* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Segoe UI', system-ui, sans-serif;
  background: #12141a;
  color: #e7e9ee;
}

.app-shell {
  max-width: 960px;
  margin: 0 auto;
  padding: 24px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 20px;
}

.brand { display: flex; align-items: center; gap: 12px; }

.brand-mark {
  width: 42px; height: 42px;
  border-radius: 10px;
  background: linear-gradient(135deg, #3d8bfd, #7b5cff);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
}

.brand h1 { font-size: 18px; margin: 0; }
.brand p { font-size: 12px; margin: 0; color: #9aa1b2; }

.environment-control { display: flex; gap: 6px; background: #1c1f28; border-radius: 8px; padding: 4px; }

.env-button {
  background: transparent; border: none; color: #9aa1b2;
  padding: 6px 12px; border-radius: 6px; cursor: pointer; font-size: 13px;
}
.env-button.is-active { background: #3d8bfd; color: #fff; }

.status-row { display: flex; gap: 16px; align-items: center; margin-bottom: 16px; flex-wrap: wrap; }

.status-pill {
  background: #1c1f28; border-radius: 20px; padding: 4px 12px; font-size: 12px;
}
.status-pill.is-online { color: #7be08a; }
.status-pill.is-offline { color: #ff8a80; }

.status-text { font-size: 12px; color: #9aa1b2; }

.toolbar { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }

button { font-family: inherit; cursor: pointer; }

.secondary-button {
  background: #1c1f28; border: 1px solid #2b2f3b; color: #e7e9ee;
  padding: 8px 14px; border-radius: 8px; font-size: 13px;
}
.secondary-button:hover { border-color: #3d8bfd; }

.primary-button {
  background: #3d8bfd; border: none; color: #fff;
  padding: 8px 16px; border-radius: 8px; font-size: 13px; font-weight: 600;
}
.primary-button:disabled { background: #2b2f3b; color: #6b7280; cursor: not-allowed; }

.panel {
  background: #181b23; border: 1px solid #23262f; border-radius: 12px;
  padding: 18px; margin-bottom: 16px;
}
.panel h2 { margin: 0 0 4px; font-size: 15px; }
.panel .hint { margin: 0 0 12px; font-size: 12px; color: #9aa1b2; }

.bindings-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.bindings-table th { text-align: left; color: #9aa1b2; font-weight: 500; padding: 6px 8px; border-bottom: 1px solid #23262f; }
.bindings-table td { padding: 6px 8px; border-bottom: 1px solid #1e2129; }

.bindings-table select {
  background: #1c1f28; color: #e7e9ee; border: 1px solid #2b2f3b;
  border-radius: 6px; padding: 5px 8px; font-size: 13px; min-width: 160px;
}

.bindings-table input[type="checkbox"] { width: 16px; height: 16px; }

.tuning-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }

.tuning-field label { display: block; font-size: 12px; color: #9aa1b2; margin-bottom: 4px; }
.tuning-field input {
  width: 100%; background: #1c1f28; color: #e7e9ee; border: 1px solid #2b2f3b;
  border-radius: 6px; padding: 6px 8px; font-size: 13px;
}

#jsonEditor {
  width: 100%; min-height: 260px; background: #10121a; color: #d7e0ff;
  border: 1px solid #2b2f3b; border-radius: 8px; padding: 12px;
  font-family: 'Cascadia Code', Consolas, monospace; font-size: 12px; resize: vertical;
}
