/* M8X top bar, scoped to avoid altering PHPRunner generated controls. */
.m8x-topbar {
  box-sizing: border-box;
  background: #fff;
  color: #0f172a;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(15,23,42,.035);
  padding: 14px 16px 12px;
  margin: 10px 16px 16px;
  font-family: inherit;
}
.m8x-topbar *, .m8x-topbar *::before, .m8x-topbar *::after { box-sizing: border-box; }
.m8x-topbar-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; padding-bottom: 12px; margin-bottom: 12px;
  border-bottom: 1px solid #e2e8f0;
}
.m8x-topbar-brand { display: flex; align-items: center; gap: 9px; min-width: 0; }
.m8x-topbar-mark {
  width: 28px; height: 28px; display: inline-flex; align-items: center;
  justify-content: center; border-radius: 7px; background: #2563eb; color: #fff;
  flex: 0 0 28px;
}
.m8x-topbar-brand-name { font-weight: 750; letter-spacing: -.02em; font-size: 16px; }
.m8x-topbar-brand-sub { color: #94a3b8; font-size: 11px; margin-left: 3px; }
.m8x-topbar-actions { display:flex; align-items:center; gap:7px; }
.m8x-topbar-action { display:inline-flex; align-items:center; justify-content:center;
  width:28px; height:28px; border-radius:7px; color:#334155; }
.m8x-header-icon { display:block; }
.m8x-topbar-controls { display:grid; grid-template-columns:1fr 1fr; gap:12px; }
.m8x-topbar-field { margin:0; display:flex; flex-direction:column; gap:5px; min-width:0; }
.m8x-topbar-field label { color:#64748b; font-size:12px; font-weight:500; margin:0; }
.m8x-topbar-field select {
  display:block; width:100%; height:39px; min-width:0;
  border:1px solid #cbd5e1; border-radius:7px; padding:8px 32px 8px 11px;
  background-color:#fff; color:#0f172a; font-size:13px; line-height:1.25;
  outline-offset:2px; cursor:pointer;
}
.m8x-topbar-field select:focus { border-color:#2563eb; outline:2px solid #bfdbfe; }
.m8x-topbar-field select:disabled { opacity:.6; cursor:not-allowed; }
.m8x-topbar-footer {
  display:flex; align-items:center; justify-content:space-between;
  gap:8px; margin-top:10px;
}
.m8x-topbar-plan { background:#f1f5f9; color:#334155;
  font-size:11px; font-weight:600; border-radius:999px; padding:3px 9px; }
.m8x-topbar-note { font-size:11px; color:#94a3b8; }
.m8x-context-error { border:1px solid #fecaca; padding:12px;
  background:#fff7f7; color:#991b1b; border-radius:8px; margin:10px 16px; }
@media (max-width:760px) {
  .m8x-topbar { margin:8px 8px 12px; padding:11px; }
  .m8x-topbar-controls { grid-template-columns:1fr; gap:9px; }
  .m8x-topbar-brand-sub { display:none; }
  .m8x-topbar-note { display:none; }
}
